Data frame with lots of columns - when imported creates NAs in columns without data

49 Views Asked by At

I am working on cleaning some data that is being imported from a csv file. The data frame has 2998 columns. However, when I import the data, it creates NAs in several columns past 2998. I have tried deleting those columns using codel like: DF <- DF[, c(-2999)], but it doesn't do anything (in the environment it says I only have 2998 columns).

how the data look as exported in a csv

How do I remove those NAs?

1

There are 1 best solutions below

0
On

I ended up solving this. I had several text questions where participants had used commas in their answers. Every time they used a comma it pushed their data one column to the right and introduced NAs.