Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R与OneDrive目录名_R_Windows_Rstudio_Onedrive - Fatal编程技术网

R与OneDrive目录名

R与OneDrive目录名,r,windows,rstudio,onedrive,R,Windows,Rstudio,Onedrive,我在Windows 10下使用Microsoft R 3.3.1,在使用R和Microsoft OneDrive for Business时遇到问题 考虑以下几点: > dir() ... [31] "OneDrive – Innherred Samkommune" ... > setwd(dir()[31]) > setwd("..") > setwd("OneDrive – Innherred Samkommune") Error in setwd("OneDrive

我在Windows 10下使用Microsoft R 3.3.1,在使用R和Microsoft OneDrive for Business时遇到问题

考虑以下几点:

> dir()
...
[31] "OneDrive – Innherred Samkommune"
...
> setwd(dir()[31])
> setwd("..")
> setwd("OneDrive – Innherred Samkommune")
Error in setwd("OneDrive – Innherred Samkommune") : 
cannot change working directory
> p <- getwd(dir()[31])
> r <- "OneDrive – Innherred Samkommune"
> p
[1] "OneDrive – Innherred Samkommune"
> r
[1] "OneDrive – Innherred Samkommune"
> p == r
[1] FALSE
>dir()
...
[31]“OneDrive–Innherred Samkommune”
...
>setwd(dir()[31])
>setwd(“…”)
>setwd(“OneDrive–Innherred Samkommune”)
setwd中出错(“OneDrive–Innherred Samkommune”):
无法更改工作目录
>p r p
[1] “OneDrive–Innherred Samkommune”
>r
[1] “OneDrive–Innherred Samkommune”
>p==r
[1] 假的
结果表明substr(p,10,10)与substr(r,10,10)不匹配。这是“-”。但是你看:

> pp <- substr(p,10,10)
> rr <- substr(r,10,10)
> pp == rr
[1] FALSE
> charToRaw(pp)
[1] 96
> charToRaw(rr)
[1] 96
>pp-rr-pp==rr
[1] 假的
>沙托劳(pp)
[1] 96
>沙托劳(右)
[1] 96
显然,微软提供的“-”有些奇怪。这显然不是编码问题。不,“-”是硬编码的,任何寄存器欺骗都不能改变它

欢迎提出任何建议


谢谢。

所有.equal(pp,rr)返回什么?我在你的问题中看到了一个
-
和一个
-
。这些显然是不同的字符。all.equal(pp,rr)返回[1]“1字符串不匹配”我从你的问题中复制了破折号:
charToRaw(“-”
返回
[1]2d
charToRaw(“-”)
返回
[1]96
不要介意问题中的破折号,它们在原始代码中是相同的。Windows试图在复制和粘贴时变得可爱。
all.equal(pp,rr)
返回什么?我在你的问题中看到了一个
-
和一个
-
。这些显然是不同的字符。all.equal(pp,rr)返回[1]“1字符串不匹配”我从你的问题中复制了破折号:
charToRaw(“-”
返回
[1]2d
charToRaw(“-”)
返回
[1]96
不要介意问题中的破折号,它们在原始代码中是相同的。Windows在复制和粘贴时会尽量表现得可爱。