# saving the work as ... data_full.csv
write.csv(data.full, "data_full.csv", col.names = TRUE)
#importing file
data.dir <- file.choose()
data <- read.csv(data.dir, header = TRUE)
data.full
was written as
but data
got read as
Can anyone suggest me a solution, on how to solve this simple problem?
Saving an Excel file as a CSV file can create extra commas at the end of each row. Trailing commas can result when columns are deleted or column headers removed. When the file is uploaded to Clever, an extra trailing comma will skew subsequent rows of data, preventing them from being processed.
Re: Handling 'comma' in the data while writing to a CSV. So for data fields that contain a comma, you should just be able to wrap them in a double quote. Fields containing line breaks (CRLF), double quotes, and commas should be enclosed in double-quotes.
Cell Character Limits csv files have a limit of 32,767 characters per cell. Excel has a limit of 1,048,576 rows and 16,384 columns per sheet. CSV files can hold many more rows.
You can't hide a column, but you can adjust a column size so one column has only 1 character width. You might want to clear the Adjust Separator Positions Automatically check box in the CSV page of the Customize dialog box if you have not done already.
In your write.csv
statement use the option row.names=FALSE
to suppress the first column - it is on by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With