I'm currently trying to read two .csv files, edit the data, and then write it into a new .csv.
here the code :
data <- read.csv("file.csv"), fill=TRUE, header=TRUE, row.names=NULL, stringAsFactors=FALSE, sep=",", quote="")
write.csv(data, file="out.csv")
Here's the problem : Everything is fine with the first file (20 columns, 572 observations)
However, the other file has 163 columns and 1578 lines but when I read it with read.csv, R displays "2301 observations of 163 variables".
I tried to write this dataframe into a new csv file, and it is a total mess :
- the rows have not been written entirely, the last values are written on a new row
- there is a new column with integers from 1 to 2301
- some data which is supposed to be in file$n is written in file$(n-1) or file$(n-2)
I'm a newbie, and I must admit I'm kind of lost : any help would be highly appreciated!
Thanks
Clément