seb*_*n-c 2 windows r filepath
假设我有三个文件路径:
setwd("C:/superlongdirname")
files <- c("C:/superlongdirname/myfile.txt", "C:\\SUPERL~1\\myfile.txt", "./myfile.txt")
Run Code Online (Sandbox Code Playgroud)
这些都指向同一个文件.如果多次引用同一个文件,我可以检查它们是否确实引用了R中的同一个文件?
使用完整版本的文件路径并进行比较:
normalizePath(files[1]) == normalizePath(files[2])
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
75 次 |
| 最近记录: |