简体   繁体   English

如何在我自己的R包中包含一个需要的包?

[英]How include a requried packages inside my own package in R?

I built my own package and everything is working well. 我构建了自己的程序包,并且一切正常。 However, I need to load another packages when I load my package. 但是,加载程序包时需要加载另一个程序包。 That is, I want R loads all requires packages automatically when I load my package like this: 也就是说,当我像这样加载我的包时,我希望R自动加载所有需要的包:

library(mypackage)
loading requrie packages:
first package 
second package 

Is there any easy way? 有什么简单的方法吗?

Add them in your DESCRIPTION file, section Depends . 将它们添加到您的DESCRIPTION文件的Depends部分中。

Depends:
  first package,
  second package

You should read the book R Packages . 您应该阅读R Packages一书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在R中,如何自动安装使用我自己的包的包? - In R, how to install packages used my own package automatically? 如何让我自己的包默认安装外部包 - How to make my own package install external packages by default R:如何在我的 package 中正确包含库 - R: how to properly include libraries in my package 在编写自己的R包时,我似乎无法正确导入其他包 - When writing my own R package, I can't seem to get other packages to import correctly 加载我自己的 R 包 - Load my own R package 如何在露天包装R中添加我自己的形状文件trajLevel() - how to add my own shape file trajLevel() in openair package R 不要在 R 中暴露自己的 package 中导入包的功能 - Don't expose functions from imported packages in own package in R 下标超出了我自己的R包的范围 - subscript out of bounds of my own R Package R:在我自己的 package 中使用数据表:lapply 中的错误(.SD,平均值):object '.SD' 未找到 - R: Using data table inside my own package: Error in lapply(.SD, mean) : object '.SD' not found 如何在 R 中创建/增强我自己的雷达/极坐标图而不需要额外的软件包? - How to create/enhance my own radar/polar chart without additional packages in R?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM