The R package readODS allows you to import ODS spreadsheets to R. It’s slow, but it works. In an attempt to speed up things, I thought providing column types would help. I didn’t find an improvement, but I noticed that the documentation wasn’t really clear (“refer to readr::type_convert to specify cols specification”). It seems like you do need to refer to type_convert to understand how to specify column types, and then feed them to readODS like this:
col_types=cols(VAR1 = "f", VAR2 ="i")
So an entire call would be:
data = read_ods("spreadsheet.ods", col_names=TRUE, col_types=cols(VAR1 = "f", VAR2 = "i", VAR3= "-"))
Note: I had to explicitly use library(readr) before calling read_ods(), otherwise the cols() function was not available.
Unfortunately, the short approach using col_types=as.col_spec(“fi-“) does not seem to work.