I have a large .csv file with 20,037 observations & 355 variables all in Character form.
When I import the read_csv with readr package, I get the file is imported in R Studio with the following
Parsed with column specification:
cols(.default = col_character())
See spec(...) for full column specifications.
All columns are with character type.
On second attempt I gave the following command to test if data type change is possible,I got the following output
data2 <- read_csv("kaggle-survey-2020/kaggle_survey_2020_responses.csv", col_types = cols(Q1 = col_double()))
Warning: 20037 parsing failures.
row col expected actual file
1 Q1 a double What is your age (# years)? 'kaggle-survey-2020/kaggle_survey_2020_responses.csv'
And when I tried to check if data is transformed from character to double the data, I got the following response
head(data2$Q1, 6)
[1] NA NA NA NA NA NA
How can I change the column wise data class to double, logical etc.