j解决sparkr中使用某些r的原生函数 发生错误Error: class(objId) == "jobj" is not TRUE的问题
Create table function in Spark in R not working
Hello, I'm trying to create a simple table in Bluemix Spark (R) but getting a error I can't understand or find useful reference about. Has anyone seen something similar? Any suggestions, please?
one <- rep(1,2)two <- rep(2,2)my_table <- table(one,two)my_tableError: class(objId) == "jobj" is not TRUETraceback:1. table(one, two)2. callJMethod(sqlContext, "table", tableName)3. stopifnot(class(objId) == "jobj")4. stop(sprintf(ngettext(length(r), "%s is not TRUE", "%s are not all TRUE"),. ch), call. = FALSE, domain = NA)
由 Sven Hafeneger (176) 回答 | 01月04日 07:10
I think this happens due to how in R the libraries are loaded. In this case the last library loaded is "SparkR", which has a function exported with the name "table". The SparkR::table function is used, if you not fully qualify the function. That explains why in the traceback "callJMethod(sqlContext, "table", tableName)" is stated.
On workaround is to qualify the function. This worked for me for R - Spark 1.6
one <- rep(1,2)two <- rep(2,2)my_table <- base::table(one,two)my_table
However, it is interesting that it works for R - Spark 2.0.
由 RolandWeber (56) 回答 | 2016年12月12日 00:34
Does your code snippet work in other R environments? It looks very much different from the table examples that I could find. Are you sure that "rep" in your example generates a "factor"? Maybe you have to call the "factor" function explicitly, as shown in the first link?
http://www.cyclismo.org/tutorial/R/types.html#tables
由 João_Andre (3) 回答 | 2016年12月13日 12:12
Hello, yes, it used to work. I got it working now after changing kernel to "R with Spark 2.0".
Thanks for your help and the links provided.
João
由 João_Andre (3) 回答 | 01月24日 06:56
@Sven, thanks for your clear explanation.
base:::table(z)
j解决sparkr中使用某些r的原生函数 发生错误Error: class(objId) == "jobj" is not TRUE的问题的更多相关文章
- R语言学习笔记——C#中如何使用R语言setwd()函数
在R语言编译器中,设置当前工作文件夹可以用setwd()函数. > setwd("e://桌面//")> setwd("e:\桌面\")> s ...
- Xcode中使用svn时,报证书验证错误Error validating server certificate for
转:http://blog.csdn.net/yhawaii/article/details/7511141 今天使用Xcode自带的svn客户端时,总是连接不上服务器,报如下错误: Error va ...
- 解决vs2010“创建或打开C++浏览数据库文件 发生错误”的问题 Microsoft SQL Server Compact 3.5
有网友说打开vs2010安装光盘,搜索 SSCERuntime_x86-chs.msi,重新安装之.于是果断搜索,发现SSCERuntime_x86-chs.msi,另外发现一个SSCEVSTools ...
- geotrellis使用(十六)使用缓冲区分析的方式解决投影变换中边缘数据值计算的问题
Geotrellis系列文章链接地址http://www.cnblogs.com/shoufengwei/p/5619419.html 目录 前言 问题探索 采样说明 实现方案 总结 一.前言 ...
- 解决JQuery中datatables设置隐藏显示列多次提交后台刷新数据的问题
此次项目开发过程中用到了Jquery的Datatables插件,无疑他是数据列表展示,解决MVC中同步过程中先走控制器后返回视图,查询数据过程中无法提示等待的弊端, 而且他所提供的各种方法也都有较强的 ...
- Android开发中出现cannot be resolved to a variable错误,也就是R文件不能生成。
最近开始学过习Android开发,配置完成开发环境后,在创建第一个Android项目就出现了cannot be resolved to a variable错误,也就是R文件不能生成的问题. 以下是从 ...
- 15、解决14中csv用excel打开乱码的问题 open('zhihu.csv','w',newline='',encoding='utf-8-sig')
解决14中csv用excel打开乱码的问题 ,其实就是在写csv的时候把 utf-8 改成 utf-8-sig open('zhihu.csv','w',newline='',encoding='ut ...
- 解决scrollView中嵌套编辑框导致不能上下滑动的问题
EditText设置maxLines之后,文本行数超过maxLines,会网上折叠,上下滑动能够浏览全部文本. 若EditText外层有scrollView.在EditText上下滑动,不会像正常情况 ...
- 如何快速排查解决Android中的内存泄露问题
概述 内存泄露是Android开发中比较常见的问题,一旦发生会导致大量内存空间得不到释放,可用内存急剧减少,导致运行卡顿,部分功能不可用甚至引发应用crash.对于复杂度比较高.多人协同开发的项目来讲 ...
随机推荐
- Bug:java.lang.StackOverflowError: stack size 8MB
在开发的时候遇到了这个Bug:java.lang.StackOverflowError: stack size 8MB Log: 11-27 14:16:37.093 21892-21892/com. ...
- oracle视图建主键
一个项目要求视图建主键,以下是一个样例 CREATE or replace VIEW SME_V_A.... (AGENTID,AGENTNAME,BUSYNUM,RESTNUM,RESTTIME, ...
- Universal USB Installer集开源软件之佳作
有机会下载一份uui的源代码,翻看了一下,呵呵,有意思,几乎是一个开源软件的大杂烩,忽然,恍然大悟,原来,作者才是开源软件精神的代言人,不重复制造轮子的践行者啊. uui网址:https://www. ...
- Atitti 住房部建设指南
Atitti 住房部建设指南 1. 住房部建设的重要意义2 2. 房屋选址::首要核心要素,环境环境环境!!!2 2.1. 价格要素与地段..2 2.2. 与工作地距离,一般是半小时到一个半小时为好3 ...
- Atitit opencv3.0 3.1 3.2 新特性attilax总结
Atitit opencv3.0 3.1 3.2 新特性attilax总结 1. 3.0OpenCV 3 的改动在哪?1 1.1. 模块构成该看哪些模块?2 2. 3.1新特性 2015-12-21 ...
- C语言:存取结构体成员的点运算符(.)和箭头运算符(->)的区别
转自:http://blog.csdn.net/taric_ma/article/details/7397362 一直以为这两个是没有什么区别的,可以相互替换,今天又翻了一下<C语言核心技术&g ...
- 服务器搭建5 Samba实现文件共享
Samba服务器工作原理 客户端向Samba服务器发起请求,请求访问共享目录,Samba服务器接收请求,查询smb.conf文件,查看共享目录是否存在,以及来访者的访问权限,如果来访者具有相应的权限, ...
- javascript基础拾遗(六)
1.Date内置对象 获取系统时间 var now = new Date() console.log(now) console.log(now.getDate()) console.log(now.g ...
- Linux 关于Transparent Hugepages的介绍【转】
透明大页介绍 Transparent Huge Pages的一些官方介绍资料: Transparent Huge Pages (THP) are enabled by default in RHEL ...
- CentOS 7修改管理员密码
之前安装CentOS 7的时候随便输入了一个密码,现在使用需要root权限,只能重置密码了.下面是处理方法:(进入单用户模式修改root密码为例) 在启动菜单中,按e编辑所选启动项 一页内容,感觉挺陌 ...