Home > other >  R imports not the whole data from csv. How to fix it?
R imports not the whole data from csv. How to fix it?

Time:01-14

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.

CodePudding user response:

Post the error/warning message if any.

CodePudding user response:

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.

  •  Tags:  
  • Related