store output of system command into a variable in r

后端 未结 2 1105
说谎
说谎 2020-12-28 11:35

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

2条回答
  •  醉梦人生
    2020-12-28 12:08

    why not use the corresponding R function?

    a <- list.files()
    b <- list.files(recursive = TRUE)
    

    For more details

    ?list.files
    

提交回复
热议问题