R语言summary()报错object of type 'closure' is not subsettable的原因
来源:互联网 发布:矩阵的奇异值有0吗 编辑:程序博客网 时间:2024/06/05 00:13
代码
> library(mice)Error in library(mice) : 不存在叫‘mice’这个名字的程辑包> bad_ind<-accepts[,c("bad_ind")]> x<-accepts[,c("fico_score","tot_derog","tot_rev_line","rev_util","age_oldest_tr")]> imp<-mice(x,met="cart",m=1)#该方法只对数值变量进行插补,分类变量的缺失值保留Error in mice(x, met = "cart", m = 1) : could not find function "mice"> x_imp<-complete(imp)Error in complete(imp) : could not find function "complete"> data<-cbind(bad_ind,x_imp)Error in cbind(bad_ind, x_imp) : object 'x_imp' not found> data1<-data> summary(data1)Error in object[[i]] : object of type 'closure' is not subsettable> r=data1$rev_util#以rev_util里的数据进行盖帽处理Error in data1$rev_util : object of type 'closure' is not subsettable
原因分析
一般出错原因不明时一定要尽量往前倒推,
其实你看,根据这个实例你就会知道,最后summary()一个数据集时给出了
object of type ‘closure’ is not subsettable
错误是不正常的,
往前推就会发现这个错误的源头是第一行:
mice这个包没有提前载入,所以library()是无效的,
最终导致后面的一系列程序都是出错的。
至于summary()为什么会给出那样一个错误信息,这是程序内部设计的问题了。
阅读全文
0 0
- R语言summary()报错object of type 'closure' is not subsettable的原因
- SparkR去数据子集错误:object of type 'S4' is not subsettable
- 报错:object is not an instance of declaring class
- R语言报错原因
- 【已解决】Object of type 'range' is not JSON serializable
- 【已解决】Object of type 'QuerySet' is not JSON serializable
- g++编译报错原因分析cannot allocate an object of abstract type“XXX ”
- object of abstract class type "我的类" is not allowed 解决方案
- object of abstract class type "我的类" is not allowed 解决方案
- 启动robot framework报'NoneType' object is not iterable的原因
- Django 报错 'AnonymousUser' object is not iterable 的解决办法
- 报错:Could not get unknown property 'compile' for object of type
- TypeError: object of type 'zip' has no len()、'zip' object is not subscriptable
- 'NoneType' object has no attribute '__getitem__'和argument of type 'NoneType' is not iterable 异常的解决办法
- 报错:allocating an object of abstract class type
- 报错: allocating an object of abstract class type
- How to solve 'object of abstract class type "newFoo" is not allowed'?
- object is not an instance of declaring class&argument type mismatch
- (十七)四大组件的工作过程-Activity
- hdu 6050 Funny Function (数学题+快速幂)
- 大数据 (五)Hadoop-HDFS zookeeper和Hadoop-HDFS的集成
- JPA SQL查询
- 域名juying.org接广告
- R语言summary()报错object of type 'closure' is not subsettable的原因
- 二叉树的遍历
- hdu 2040 亲和数
- 2017年最受开发者欢迎的10个Linux发行版
- 杭电acm1157 中位数问题
- 日志库Logger/xLog:使用对比解析
- mysql 外键约束
- socket outputstream
- COJ1971-安排座位