[R] Help needed with my code for merging multiple xls files from google drive

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Mon Feb 11 18:17:25 CET 2019


Your example is not reproducible [1][2][3], you are reposting a copy of an email in a fresh thread (instead of replying to the first one), and you are using HTML email format on a text-only mailing list (what you see is really not what we see). Please read the Posting Guide to find out what the basic conventions are for using this mailing list. If you make the reader's job too hard they are going to ignore you.

Regarding your question... you don't seem to be executing your code one line at a time in order to debug it... you can also try executing just the read_xls function with one of the elements of the inputfiles variable to confirm whether read_xls is the problem (I think so) or whether lapply is the problem (seems unlikely). You should read the examples in the googledrive package... I suspect that the readxl package is not designed to handle google docs, but there is an as_dribble function in googledrive that may be useful for getting data out of it.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

[2] http://adv-r.had.co.nz/Reproducibility.html

[3] https://cran.r-project.org/web/packages/reprex/index.html (read the vignette)

On February 11, 2019 5:11:29 AM PST, Ross Molden <ross.l.molden using gmail.com> wrote:
>Hi guys,
>
>I am trying to merge a list of .xls files in google drive. I have now
>managed to create a list of all the files I need, but for some reason I
>still can't manage to merge them, this is the code I have so far:
>
>library(googledrive) inputfiles <- drive_ls(path = "Email It In",
>pattern = "*PDOL_dataexport", n_max = 50)
>
>library(readxl) df.list<- lapply(inputfiles,function(x) read_xls(x))
>library(dplyr) consolidated_data<-bind_rows(df.list)
>
>The second part of the code throws up the following error: 
>
>Error: path must be a string 
>
>I must be entering the path (inputfiles) incorrectly for lapply, can
>someone please help?
>
>Thank in advance!
>Ross
>	[[alternative HTML version deleted]]
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list