2017-02-13 149 views
0

我正在创建本地R软件包。为确保向后兼容性,我希望指定相关软件包的版本,以便在安装软件包时,我的软件包中使用的软件包所需版本也将自动安装。如何安装本地包的相关性的特定版本。

请问有没有办法在R本地软件包中做到这一点?

+0

https://github.com/rstudio/packrat – shayaa

+0

您可以尝试https://cran.r-project.org/web/packages/versions/index.html 然而,礼貌的方式是使用每个新版本的CRAN更新您的软件包。 –

回答

0

我会检查出哈德利韦克姆的tutorial包开发。根据你如何创建你的包(希望你使用的是devtools),你只需要添加特定的包版本到你的描述。请参阅下面的示例描述文件。

Package: mypackage 
    What The Package Does (one line, title case required) 
    Version: 0.1 
    [email protected]: person("First", "Last", email = "[email protected]", 
       role = c("aut", "cre")) 
    Description: What the package does (one paragraph) 
    Depends: R (>= 3.1.0) 
    License: What license is it under? 
    LazyData: true 
    Imports: 
     ggvis (>= 0.2), 
     dplyr (>= 0.3.0.1)