选项(" devtools.desc.author")并不坚持,

时间:2016-04-24 16:12:46

标签: r rstudio devtools

我希望devtools包能够记住我的名字,电子邮件和其他创建包的偏好。我使用以下代码更改选项

options(devtools.desc.author = person(given = "charm", family = "goggles", email = "my@email.com", role = c("cre","aut")))

当我用

检查选项时

options("devtools.desc.author")设置确实发生了变化。 但是,当我在Rstudio中打开一个新项目时,设置又回到了标准设置

options("devtools.desc.author")
$devtools.desc.author
[1] "person(\"First\", \"Last\", email = \"first.last@example.com\", role = c(\"aut\", \"cre\"))"

如何制作这些常规选项,以便它们保留在我的所有项目中?

2 个答案:

答案 0 :(得分:1)

您需要将此信息存储在.Rprofile中。您.Rprofile只是一个在启动时读取的R脚本。请参阅?.Rprofile

您可以为每个RStudio项目创建一个,或者只在家中放置一个。我怀疑你没有,所以只需运行

file.edit("~/.Rprofile")

创建并打开文件。

答案 1 :(得分:0)

感谢csgillespie

这将是最终答案:

使用

打开个人资料

file.edit("~/.Rprofile")

我在文件中写了这个:

options(devtools.desc.author = utils::person(given = "charm", family = "goggles", email = "my@email.com", role = c("cre","aut")))