I call a system command with
driveFileList <- try(as.data.frame(system(paste0("/usr/local/bin/gdrive list "), intern = TRUE, ignore.stderr = TRUE)))
1 Id Name Type Created
2 23423423 nameOfFile1.csv doc 2016-08-22 18:40:05
3 2342342 nameOfFile2.csv doc 2016-08-22 18:39:39
4 34323334 nameOfFile3.csv doc 2016-08-23 17:58:46
as.data.frame doesn’t do what you think it does. The
system command gives you back a character string (of some format), so you need to parse it. Try
read.table or a similar function (which exactly to use, and what parameters, depends on the exact output of the call).
You either need to pass the text into the function via its
text argument (i.e. result = read.table(text = system_output, …)
) or you could usepipe
instead ofsystem`, and read the resulting stream.