Help needed with my code for merging multiple xls files from google drive
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:
Re: Help needed with my code for merging multiple xls files from google drive
Your example is not reproducible , 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.
On February 11, 2019 5:11:29 AM PST, Ross Molden <[hidden email]> wrote:
>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))
>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!
> [[alternative HTML version deleted]]
>[hidden email] 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.