2017-02-13 147 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)