R could not find function "checkAtAssignment" while running XXX(R-3.2.2)

R版本差异

服务器上安装的R版本:

1
2
$ R --version
R version 3.2.2 (2015-08-14) -- "Fire Safety"

本地机器安装的R版本:

1
2
$ R --version
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"

遇到问题描述

在服务器R环境中,交互模式可以执行的东西,改成以RScript执行的时候遇到这样的报错:

1
R could not find function "checkAtAssignment" while running XXX

需要在脚本里面加载软件包:

1
library(methods)

这个bug修复信息: Fixed in svn rev 69479 (in R-devel; to be ported to R-patched) 2015-10-06

S4 对于 =methods= 有个说明:

1
All S4 related code is stored in the methods package. This package is always available when you’re running R interactively, but may not be available when running R in batch mode. For this reason, it’s a good idea to include an explicit library(methods) whenever you’re using S4.
吴羽舒 wechat
欢迎您扫一扫上面的微信公众号,订阅我的博客!