We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am writing a column-combined data (say three 500*100 matrices), but write_csv repeats the first one matrix three times in the output.csv.
reprex( library(tidyverse); set.seed(100) temp1 <- data.frame(matrix(rnorm(8760*100),nrow = 8760, ncol = 100)); temp2 <- data.frame(matrix(rnorm(8760*100,200),nrow = 8760, ncol = 100)); temp3 <- data.frame(matrix(rnorm(8760*100,300),nrow = 8760, ncol = 100)); temp4 <- cbind(temp1,temp2,temp3); write_csv(temp4, './test.csv'))
The text was updated successfully, but these errors were encountered:
Well, I did a little troubleshooting on my end. It looks like that write_csv requires that the column names to be unique? I make new names of temp4 by
colnames(temp4) <- make.names(colnames(temp4),unique = TRUE);
and then write_csv works fine. In contrast, write.csv (the default of R) works fine without making column names unique.
Should this be an issue to be fixed? Many thanks,
Sorry, something went wrong.
267e4cc
Writing with duplicated columns was a bug recently introduced by #1009, it is now fixed, so this should now work how you expect.
Thank you for opening the issue and for supplying a reproducible example, it is a big help!
Thank you Jim!
No branches or pull requests
I am writing a column-combined data (say three 500*100 matrices), but write_csv repeats the first one matrix three times in the output.csv.
The text was updated successfully, but these errors were encountered: