RStudio:使用存储在网络驱动器中的项目中的第一条指令意外调用`dir.create()` [英] RStudio: unexpected call to `dir.create()` with the first instruction within a project stored on a network drive

查看:353
本文介绍了RStudio:使用存储在网络驱动器中的项目中的第一条指令意外调用`dir.create()`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,对缺少可重复的示例表示歉意,但由于我认为问题出在我的网络设置之内,所以我无法提供一个示例。请将此问题视为在调试问题时寻求帮助的电话。

First, apologies for a lack of a reproducible example, but I cannot really provide one as I believe the problem lies within my network settings. Please treat this question as a call for help in debugging the issue...

在RStudio中打开存储在网络驱动器上的项目并运行第一个指令(即它是一个程序包负载,甚至是 a<-1 ),我在控制台中看到一个非常奇怪的输出:

After opening in RStudio a project stored on a network drive and running the very first instruction (being it a package load or even a <- 1) I am seeing a really weird output in the console:

> a <- 1
Warning message:
In dir.create(tempPath, recursive = TRUE) :
  cannot create dir 'F:\Marketing', reason 'Permission denied'

我在用户环境变量(TEMP,TMP,TMPDIR)和<$ c中设置了所有可能的临时目录$ c> Sys.getenv()正确打印它们。

I have all possible temp dirs set up in user environment variables (TEMP, TMP, TMPDIR) and Sys.getenv() is printing them correctly.

F:\Marketing是网络驱动器上的有效路径这是项目的根目录。

"F:\Marketing" is a valid path on my network drive and it is a root directory of the project.

我尝试在中 。通过RProfile查看tempPath是什么,但不幸的是,这导致了无效的'envir'参数错误。

I have tried to debugonce(dir.create) in .RProfile to see what the tempPath is, but unfortunately this resulted in an "invalid 'envir' argument" error.

将项目复制到本地驱动器后,问题消失了,因此,这显然是网络驱动器/网络设置的问题,但是我不知道在哪里进行挖掘以及我的IT部门。在这里不是真的有用...

After copying the project to a local drive the problem disappears, so this is clearly a network drive/network setup problem, but I do not know where to dig more and my IT dept. is not really useful here...

有什么方法可以调试此警告?

Any ideas how to debug this warning?

推荐答案

错误消息非常明确。这与您的临时工作无关。您需要在该位置创建文件夹的权限。

The error message is very clear. It is not about your temp dirs. It is that you need permission to create a folder at the place.

一种可能性是您无权在此类位置创建文件夹,例如,许多用户共享网络驱动器,而普通用户却没有有权在根目录下创建文件夹。在这种情况下,除您的IT部门外,没有人可以授予您权限,或者您可以尝试在自己的个人文件夹下创建该文件夹。

One possibility is that you don't have the permission to create a folder at such places, for example the network drive is shared by many users and normal users don't have the permission to create folders at root directory. If this is the case, no one can give the permission to you except your IT dept, or you can try to create the folder under your own personal folder.

如果您认为自己具有创建文件夹的权限,例如具有sudo权限,也许可以尝试使用 system('sudo mkdir -p tempPath')

If you believe you have the permission to create the folder, for example you have the sudo permission, maybe you can try using system('sudo mkdir -p tempPath').

编辑:对不起,我没有注意到这是Windows系统,而 sudo 不可用。但是这个想法是相似的。也许您可以尝试以管理员身份运行或类似的方法。

Sorry I didn't notice this is windows system, and sudo is not available. But the idea is similar. Maybe you can try "run as administrator" or something like that.

这篇关于RStudio:使用存储在网络驱动器中的项目中的第一条指令意外调用`dir.create()`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆