Description Usage Arguments Details Value
Read csv Files with Given Column Classes
1 2 3 4 5 6 7 8 9 10 |
file, header, sep, colClasses, skip, quote, stringsAsFactors, ... |
passed to |
Reading a csv file using builtin function
read.csv
might result in some unexpected
behavior. safe_read_csv
does some preprocessing on the
format so that it take cares of the following cases.
1. If skip
exceeds the maximum rows of the data, return
a blank data frame instead of raising error.
2. If row names are included in the file, colClasses
automatically skip that column and starts from the second column
3. If length of colClasses
does not equal to the number of
columns, instead of cycling the class types, we set those columns
to be NA
type and let read.csv
decide
the default types.
4. stringsAsFactors
is by default FALSE
to be
consistent with R 4.0, if the function is called in R 3.x.
A data frame
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.