I am executing the following command in R :
system(\"ls \")
I need to store the output of the above command in some R variable. Is there a
why not use the corresponding R function?
a <- list.files() b <- list.files(recursive = TRUE)
For more details
?list.files
Use intern=TRUE:
intern=TRUE
a <- system("ls ", intern = TRUE)