Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 R 中执行以下命令:
system("ls ")
我需要将上述命令的输出存储在某个 R 变量中。有没有办法做同样的事情?
使用intern=TRUE:
intern=TRUE
a <- system("ls ", intern = TRUE)
为什么不使用相应的 R 函数?
a <- list.files() b <- list.files(recursive = TRUE)
更多细节
?list.files