col - Write a data frame to csv file without column header in R -


this question has answer here:

i store contents of data frame .csv file without names of columns. use following piece of code,

write.csv(cur_data,new_file, row.names = f, col.names=f) 

the resulting file looks this,

"v1","v2" -0.02868862,5.442283e-11 -0.03359281,7.669754e-12 -0.03801883,-1.497323e-10 -0.04320051,-6.557672e-11 

however have file in following format,

-0.02868862,5.442283e-11 -0.03359281,7.669754e-12 -0.03801883,-1.497323e-10 -0.04320051,-6.557672e-11 

i don't understand why the col.names parameter in code not taken consideration

dont use write.csv, use write.table

 write.table( <yourdf>, sep=",",  col.names=false) 

you cannot change many settings in write.csv -- arguments there reminder user. documentation:

these wrappers deliberately inflexible: designed ensure correct conventions used write valid file. attempts change append, col.names, sep, dec or qmethod ignored


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -