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

data.table(matrix) converts strings to factors #745

Closed
fpinter opened this issue Jul 31, 2014 · 2 comments
Closed

data.table(matrix) converts strings to factors #745

fpinter opened this issue Jul 31, 2014 · 2 comments
Assignees

Comments

@fpinter
Copy link

fpinter commented Jul 31, 2014

As documented in this SO question: data.table still converts strings to factors?

library(data.table)
m <- matrix(letters[1:4], ncol=2)
str(data.table(m))

shows that the strings are still being converted to factors.
This works, though:

str(data.table(data.frame(m, stringsAsFactors=FALSE)))

The SO question's a year old but I can't find a bug report corresponding to it.

@nigmastar
Copy link

@arunsrinivasan
Copy link
Member

Thanks for noticing and reporting the issue here, @fpinter. It should be fixed now. We do try to file issues as and when we notice (from SO). But sometimes it does get slipped past us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants