具有一个包含子文件夹的文件夹,以及带有这些子文件夹(如.CSS,.java等)的各种源代码文件。是否可以将所有这些源代码文件列出为具有两列(路径和文件名)的表格式< / p>
root
|-- features: array (nullable = true)
| |-- element: struct (containsNull = true)
| | |-- geometry: struct (nullable = true)
| | | |-- coordinates: array (nullable = true)
| | | | |-- element: array (containsNull = true)
| | | | | |-- element: array (containsNull = true)
| | | | | | |-- element: double (containsNull = true)
| | | |-- type: string (nullable = true)
| | |-- properties: struct (nullable = true)
| | | |-- auswertezeit: string (nullable = true)
| | | |-- geschwindigkeit: long (nullable = true)
| | | |-- strecke_id: long (nullable = true)
| | | |-- verkehrsstatus: string (nullable = true)
| | |-- type: string (nullable = true)
|-- type: string (nullable = true)
不起作用。我尝试了其他功能,例如all_files<-list.files(pattern = "*.*", recursive = TRUE)
似乎无法休息。
答案 0 :(得分:3)
fils <- list.files("thedir", recursive = TRUE)
data.frame(
path = dirname(fils),
file = basename(fils),
stringsAsFactors = FALSE
)