Reputation: 107
I faced an issue of importing data from csv
file to R.
Some basic information on the file. There are 1941 rows and 78 columns.
When I import data using the following command
data = read.csv("data.csv", header = T, sep = ";")
I get 824 rows only.
But when I convert the file into the xlsx
format and then import the xlsx
file using this command
data = read_excel("data.xlsx")
everything is ok.
I cannot fix the problem because I don't know where it is.
Can you help me please?
P.S. Unfortunately I cannot share file eith you as soon as that file is a top secret.
Upvotes: 0
Views: 684
Reputation: 107
The solution of the problem is to add the parameter quote=""
in the code like this:
data = read.csv("data.csv", header = T, sep = ";", quote = "")
That's it.
Upvotes: 2
Reputation: 51
When you open your data see if you have problematic characters inside columns, like tabs, comas, new lines etc.
I would suggest to read by line as a text file to check the issue.
Without looking onto what in the data causing the problem I guess no one could give you a solution.
Upvotes: 0