admin管理员组文章数量:1363706
I am using Here
R package in my R projects. At the beginning, when I was having a project, here seemed working fine. Thus I decided to adopt for the remaining projects.
However, I am having troubles when I have to use it in multiple projects`.
For example, In the project2, in one of the scripts (new.R
), where i need to source another script (dependency.R
). The new.R
and dependency.R
are in the same root directory (of project2).
When I do this normally,source(here(dependency.R)
, it gives me
Error in file(filename, "r", encoding = encoding) : cannot open the connection In addition: Warning message: In file(filename, "r", encoding = encoding) : cannot open file '/path/to/project1/dependency.R': No such file or directory
I have noticed thanks to this error message, that in RStudio, the project dropdown still shows that the project1
. When I close the project and open just the new.R
, I get the same error except that I am now in my home directory (/home/user/dependency.R
). Thus I was wondering how to properly use here
in different projects and limit the scope of `here` to respective project?
My current research tells me to locate using here::here_iam(path/to/README.md)
manually. But how is this different from setting the path manually without using here
?
My projects are also git repos and I am ok to have them only as git repos (important for me) and not as RProjects at simultaneously. Thus, When I retried, having them only as git repos, I still get the error that I am in the `home/user/` directory not at the project's root directory.
本文标签: rstudioUsing here R package in multiple projectsStack Overflow
版权声明:本文标题:rstudio - Using `here` R package in multiple projects - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743750852a2532616.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论