Exploratory Community

When importing a CSV file, it does not show all rows in the created data frame

#1

When Importing a CSV file, you might notice that not all the rows are imported in Exploratory Desktop.

This typically happens when your CSV file contains incorrectly quoted strings like below.

In this case, New York, NY is wrapped inside double quotation but at the end of the column, it has an extra double quotation.

If this happens, you’ll see fewer rows in the imported in a resulting data frame.

To debug which rows/columns of your CSV have issues, you can create a Note and click the R button on the toolbar.
Change the first line warning=TRUE, message=TRUE parts. Then put an R script inside the code block. (Make sure to change file path, delim, and other parameters with the ones that work for your CSV)

example:

df <- exploratory::read_delim_file("/SomePath/your_csv_file.csv", delim = ",", quote = "\"", skip = 0 , col_names = TRUE , na = c('','NA') , locale=readr::locale(encoding = "UTF-8", decimal_mark = ".", tz = "America/Los_Angeles", grouping_mark = "," ), trim_ws = TRUE , progress = FALSE)

problems(df)

Then if you click the Run button, you can see which rows and columns have issues.

1 Like