Gdata package perl issue

后端 未结 10 2340
无人及你
无人及你 2021-02-07 05:03

I am attempting to follow this easy 2-minute video tutorial on importing an Excel spreadsheet into R as a data frame: http://www.screenr.com/QiN8

I followed each step, i

10条回答
  •  温柔的废话
    2021-02-07 05:39

    After loading the gdata package using library(gdata) it clearly says:

    gdata: read.xls() will be unable to read Excel XLS and XLSX files gdata: unless the 'perl=' argument is used to specify the location of a gdata: valid perl intrpreter.

    So, you need the PATH to the valid perl interpreter. Using windows, as is the case here, you need to check the properties to locate the required perl interpreter.

    #set the PATH to perl interpreter
    perl <- "C:/strawberry/perl/bin/perl5.18.2.exe"
    
    try1file <- read.xls("my.one.filename.xls", perl = perl)
    

    For multiple xls files:

    > length(list.files())
    [1] 65
    
    try65files <- lapply(list.files(), ..., perl = perl) 
    

    If verbose = TRUE, at the end of each file it will read:

    Loading 'F65.xls'...
    Done.
    Orignal Filename: F65.xls
    Number of Sheets: 1
    Writing sheet number 1 ('Sheet1') to file 'C:\Users\FRANKL~1.JOH\AppData\Local\Temp\RtmpeKs3fi\file13dc750950e4.csv'
    Minrow=0 Maxrow=32 Mincol=0 Maxcol=16
      (Ignored 0 blank lines.)
    0 
    Done.
    Reading csv file  “C:\Users\FRANKL~1.JOH\AppData\Local\Temp\RtmpeKs3fi\file13dc750950e4.csv” ...
    Done.
    

提交回复
热议问题