I have a .xlsx file (~70MB) (it's the 2022 National Youth Tobacco Survey data) that I'd like to read into R. I am trying to find a faster way than read_excel from readxl to read the file.
> system.time(df <- read_excel("nyts2022.xlsx"))
user system elapsed
20.25 3.61 70.70
From the answer on this SO question, it appears that fread is more efficient and can convert the file to .csv using command line. But I get an error:
> df <- fread('in2csv nyts2022.xlsx')
'in2csv' is not recognized as an internal or external command,
operable program or batch file.
Warning messages:
1: In (if (.Platform$OS.type == "unix") system else shell)(paste0("(", :
'(in2csv nyts2022.xlsx) > C:\Users\cloft\AppData\Local\Temp\RtmpuwQ2G6\file54a06407ad3' execution failed with error code 1
2: In fread("in2csv nyts2022.xlsx") :
File 'C:\Users\cloft\AppData\Local\Temp\RtmpuwQ2G6\file54a06407ad3' has size 0. Returning a NULL data.table.
How do I go about doing this? I'm a newbie, so any help is appreciated.