获取具有更近期CRAN版本的软件包列表

huangapple go评论93阅读模式
英文:

R get list of packages that have a more recent CRAN version

问题

我能够帮你翻译代码部分,请看下面:

如何获取一个包含所有在CRAN上有更新版本的包的数据框?例如:

df <- check_outdated_packages() # 请创建这个函数

> df
     package    installed_version    latest_cran_version
      <char>               <char>                 <char>
1: reactable                0.3.0                  0.4.4

请注意,这是代码部分的翻译。如果你需要更多帮助或其他问题的翻译,请随时提出。

英文:

How can I get a dataframe of all the packages that have a more recent version in CRAN? For example:

df &lt;- check_outdated_packages() # please create this function

&gt;df
     package    installed_version    latest_cran_version
      &lt;char&gt;               &lt;char&gt;                 &lt;char&gt;
1: reactable                0.3.0                  0.4.4

答案1

得分: 6

以下是您要翻译的内容:

"?old.packages" 说:

‘old.packages’ 表示在仓库中有一个(合适的)较新版本的软件包,而 ‘update.packages’ 提供下载和安装这些软件包。

它返回:

‘NULL’ 或一个矩阵,每个软件包一行,行名为软件包名称,列名为 ‘"Package"’、‘"LibPath"’、‘"Installed"’(版本)、‘"Built"’(构建版本)、‘"ReposVer"’ 和 ‘"Repository"’。

在我的系统上:

        Package    LibPath                         Installed Built   ReposVer
admisc   "admisc"   "/usr/local/lib/R/site-library" "0.31"    "4.3.0" "0.32"  
clock    "clock"    "/usr/local/lib/R/site-library" "0.6.1"   "4.3.0" "0.7.0" 
markdown "markdown" "/usr/local/lib/R/site-library" "1.6"     "4.4.0" "1.7"   
rticles  "rticles"  "/usr/local/lib/R/site-library" "0.24"    "4.3.0" "0.25"  
MASS     "MASS"     "/usr/local/lib/R/library"      "7.3-59"  "4.4.0" "7.3-60"

         Repository                               
admisc   "https://cloud.r-project.org/src/contrib"
clock    "https://cloud.r-project.org/src/contrib"
markdown "https://cloud.r-project.org/src/contrib"
rticles  "https://cloud.r-project.org/src/contrib"
MASS     "https://cloud.r-project.org/src/contrib"

(我记得这个存在:我使用 apropos("package") 来找到它。)

英文:

?old.packages says:

> ‘old.packages’ indicates packages which have a (suitable) later
version on the repositories whereas ‘update.packages’ offers to
download and install such packages.

it returns:

> ‘NULL’ or a matrix with one row per package,
row names the package names and column names ‘"Package"’,
‘"LibPath"’, ‘"Installed"’ (the version), ‘"Built"’ (the version
built under), ‘"ReposVer"’ and ‘"Repository"’.

On my system right now:

        Package    LibPath                         Installed Built   ReposVer
admisc   &quot;admisc&quot;   &quot;/usr/local/lib/R/site-library&quot; &quot;0.31&quot;    &quot;4.3.0&quot; &quot;0.32&quot;  
clock    &quot;clock&quot;    &quot;/usr/local/lib/R/site-library&quot; &quot;0.6.1&quot;   &quot;4.3.0&quot; &quot;0.7.0&quot; 
markdown &quot;markdown&quot; &quot;/usr/local/lib/R/site-library&quot; &quot;1.6&quot;     &quot;4.4.0&quot; &quot;1.7&quot;   
rticles  &quot;rticles&quot;  &quot;/usr/local/lib/R/site-library&quot; &quot;0.24&quot;    &quot;4.3.0&quot; &quot;0.25&quot;  
MASS     &quot;MASS&quot;     &quot;/usr/local/lib/R/library&quot;      &quot;7.3-59&quot;  &quot;4.4.0&quot; &quot;7.3-60&quot;

         Repository                               
admisc   &quot;https://cloud.r-project.org/src/contrib&quot;
clock    &quot;https://cloud.r-project.org/src/contrib&quot;
markdown &quot;https://cloud.r-project.org/src/contrib&quot;
rticles  &quot;https://cloud.r-project.org/src/contrib&quot;
MASS     &quot;https://cloud.r-project.org/src/contrib&quot;

(I thought I remembered this existed: I did apropos(&quot;package&quot;) to find it.)

huangapple
  • 本文由 发表于 2023年5月17日 07:49:16
  • 转载请务必保留本文链接:https://go.coder-hub.com/76267745.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定