我试图从包installr
中配置updateR()
以使用我公司的内部CRAN为最终用户提供更容易的升级。 updateR()
利用另一个函数check.for.updates.R()
来确定是否存在更新的版本。 check.for.updates.R()
有一个参数,我想设置为"http://internal/cran/bin/windows/base/"
。我使用formals(check.for.updates.R)$page_with_download_url = "http://lnxaws01/cran/bin/windows/base/"
尝试设置默认参数。R - 更改嵌套函数调用的默认参数
formals(check.for.updates.R)
#>$notify_user
#>[1] TRUE
#>
#>$use_GUI
#>[1] TRUE
#>
#>$page_with_download_url
#>[1] "http://internal/cran/bin/windows/base/"
#>
#>$pat
#>[1] "R-[0-9.]+-win"
所以,这似乎工作。检查它的实际工作:
check.for.updates.R(use.GUI=F)
#>No need to update. You are using the latest R version:
R version 3.1.3 (2015-03-09)[1] FALSE
注 - 在此发布的时候,R 3.2.0刚刚发布,我们的内部CRAN仍在运行3.1.3所以这是正确的响应。
但是,updateR()
继续检查RStudio CRAN,并最终认为有一个新的包可用。
从CRAN中删除Defaults
包(也许它不会有任何帮助)我如何更改嵌套在另一个函数中的函数的默认参数值?
这真是太棒了,谢谢。 – Mark