zoukankan      html  css  js  c++  java
  • Updating an R installation

    Updating an R installation

    update.packages() function can be used to download and install the most recent  version of a contributed package.

    http://cran.r-project.org/bin

    The installed.packages() function is used to save a list of packages to a location  outside of the R director y tree, and then the list is used with the install.packages()  function to download and install the latest contributed packages into the new R installation.

    Here are the steps:

    1 If you have a customized Rprofile.site file (see appendix B), save a copy outside of R.

    2 Launch your current version of R and issue the following statements

    oldip <- installed.packages()[,1]

    save(oldip, file="path/installedPackages.Rdata")

    where path is a director y outside of R.

    3 Download and install the newer version of R.

    4 If you saved a customized version of the Rprofile.site file in step 1, copy it into the new installation.

    5 Launch the new version of R, and issue the following statements

    load("path/installedPackages.Rdata")

    newip <- installed.packages()[,1]

    for(i in setdiff(oldip, newip))

      install.packages(i)

    eg:

    oldip <- installed.packages()[,1]
    save(oldip, file="D:\\app\\rlib\\installedPackages.Rdata")

    # down load from http://cran.r-project.org/
    load("D:\\app\\rlib\\installedPackages.Rdata")
    newip <- installed.packages()[,1]
    for(i in setdiff(oldip, newip))
    install.packages(i)

     

     

    where path is the location specified in step 2.

    6 Delete the old installation (optional).

     

    source(http://bioconductor.org/biocLite.R)

    biocLite("globaltest")

    biocLite("Biobase")

    tanhao2013@foxmail.com || http://weibo.com/buttonwood
  • 相关阅读:
    9. Palindrome Number
    7. Reverse Integer
    650. 2 Keys Keyboard
    646. Maximum Length of Pair Chain
    523. Continuous Subarray Sum
    516. Longest Palindromic Subsequence
    dp问题解题思路
    494. Target Sum
    小波变换网文精粹:小波:看森林,也看树木(一)
    数学、海豚和花朵
  • 原文地址:https://www.cnblogs.com/buttonwood/p/2593935.html
Copyright © 2011-2022 走看看