Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fwrite coerces input to data.table when given a matrix #3125

Merged
merged 9 commits into from
Dec 6, 2018

Conversation

fparages
Copy link
Member

Closes #2613

When given a matrix as an input, fwrite now coerces it to a class data.table, to avoid an error in the stopifnot(is.list(x))

Copy link
Member

@MichaelChirico MichaelChirico left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the warning before the conversion, since that step might be slow

@jangorecki
Copy link
Member

I am not sure if warning is really necessary. Coercing can be slow but I think there is no other faster alternative, so it is still proper way to go.
I would extend tests a little bit more, matrix("foo") is kind of edge case of matrix. We should also test matrices of bigger dimensions, like

matrix(1:3, nrow=1, ncol=3)
matrix(1:3, nrow=3, ncol=1)
matrix(1:9, nrow=3, ncol=3)

and matrices having dimnames, both named columns and rows.

R/fwrite.R Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 21, 2018

Codecov Report

Merging #3125 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3125      +/-   ##
==========================================
+ Coverage   92.34%   92.34%   +<.01%     
==========================================
  Files          61       61              
  Lines       11582    11585       +3     
==========================================
+ Hits        10695    10698       +3     
  Misses        887      887
Impacted Files Coverage Δ
R/fwrite.R 96.29% <100%> (+0.21%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f0023a1...91dcb81. Read the comment docs.

@fparages
Copy link
Member Author

fparages commented Dec 5, 2018

Hi @MichaelChirico @jangorecki
Any update about this PR? Is it good to get merged?
Thanks!!

@mattdowle mattdowle added this to the 1.12.0 milestone Dec 6, 2018
@mattdowle mattdowle merged commit 7eefead into Rdatatable:master Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants