标签: r
使用新库运行脚本时,我会自动使用Error in library(x) : there is no package called ‘x’回复错误消息install.packages("x")。有没有办法自动化这个过程?
Error in library(x) : there is no package called ‘x’
install.packages("x")
答案 0 :(得分:0)
if(! require("x")) install.packages("x")
但请参阅Check if R package is installed then load library了解更强大的解决方案