R_Language 板


LINE

7/26 16:23更新: 後来测试成功,重点在於设定dom的名称 code: http://pastebin.com/6c0gdc1Y nPlot成功案例:http://tinyurl.com/ovuxmpt 7/26 15:10写的: 我跑是没出现任何警告跟错误,我的环境列於下方: 而且有正常呈现,不过你的scatter_plot那个tab没有图就是 > sessionInfo() R version 3.2.0 (2015-04-16) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=Chinese (Traditional)_Taiwan.950 [2] LC_CTYPE=Chinese (Traditional)_Taiwan.950 [3] LC_MONETARY=Chinese (Traditional)_Taiwan.950 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Traditional)_Taiwan.950 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] shiny_0.11.1 rCharts_0.4.5 loaded via a namespace (and not attached): [1] R6_2.0.1 plyr_1.8.2 htmltools_0.2.6 tools_3.2.0 [5] whisker_0.3-2 yaml_2.1.13 Rcpp_0.11.5 RJSONIO_1.3-0 [9] grid_3.2.0 digest_0.6.8 xtable_1.7-4 httpuv_1.3.2 [13] mime_0.3 lattice_0.20-31 测试code: http://pastebin.com/qxpRSm0y (我只是把ui.R跟server.R合并到function而已) ※ 引述《ardodo (米虫)》之铭言: : [问题类型]: : : 程式谘询(我想用R 做某件事情,但是我不知道要怎麽用R 写出来) : : [软体熟悉度]: : 请把以下不需要的部份删除 : 入门(写过其他程式,只是对语法不熟悉) : : [问题叙述]: : 版友好,我试着以rCharts在shiny上绘制iris的散布图,但是画不出来,不知道为什麽 : code在此 http://pastebin.com/EkS2YxcC : 执行shiny後,会跳出以下的讯息: : Note: the specification for S3 class “AsIs” in package ‘jsonlite’ seems : equivalent to one from package ‘RJSONIO’: not turning on duplicate class : definitions for this class. : 恳请解答,感谢 : 附上我的sessionInfo : other attached packages: : [1] rCharts_0.4.5 shiny_0.12.1 : loaded via a namespace (and not attached): : [1] Rcpp_0.11.6 lattice_0.20-31 digest_0.6.8 mime_0.3 : grid_3.2.1 : [6] R6_2.1.0 plyr_1.8.3 xtable_1.7-4 jsonlite_0.9.16 : rstudioapi_0.3.1 : [11] whisker_0.3-2 RJSONIO_1.3-0 tools_3.2.1 httpuv_1.3.2 : yaml_2.1.13 : [16] rsconnect_0.4.1.2 htmltools_0.2.6 --



※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 123.205.27.107
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/R_Language/M.1437894791.A.4C4.html
1F:推 ardodo: 感谢版主的回文,看起来rCharts的不同套件功能如hPlot, 07/27 11:44
2F:→ ardodo: rPlot, nPlot在设定上略有不同,而重点就是dom要指名 07/27 11:45
3F:→ ardodo: 不晓得哪里有rCharts底下各种图的用法说明文件? 07/27 11:45
4F:→ ardodo: 我找了好久只找到rCharts Documentation比较完整 07/27 11:46
5F:→ ardodo: 想知道如何设定图形大小、margin等图形参数 07/27 11:47
我也仔细去查过了,rCharts只有examples 你要修正rCharts,只能去看他们只使用的library,然後去做修改 你在rCharts的github可以看到相关的叙述 rCharts supports multiple javascript charting libraries, each with its own strengths. Each of these libraries has multiple customization options, most of which are supported within rCharts. More documentation is underway on how to use rCharts with each of these libraries. 所以细部设定的文件都还在写,不过你那些js library的选项大都有支援 因此,你可以尝试去查那些js library做参数修改
6F:推 ardodo: 原来如此,所以就是要查看看这些rCharts支援的js library 07/27 12:04
7F:→ ardodo: 是怎麽设定图形的罗?感谢回答 07/27 12:04
举例来说,我要改chart一些参数,你可以从nvd3找到 透过chart这个函数你可以去设定他的参数(这部分我直接去翻source code) library(rCharts) h = 600 w = 600 padding = 40 n1 = nPlot(Sepal.Length ~ Sepal.Width, data = iris, group = "Species", type = "scatterChart") xlim = range(iris$Sepal.Width) xlim = xlim * c(0.95, 1.05) + diff(xlim) * c(-0.1, 0.1) ylim = range(iris$Sepal.Length) ylim = ylim * c(0.95, 1.05) + diff(ylim) * c(-0.1, 0.1) n1$chart(xRange = c(0, w - padding), yRange = c(h-padding*2, padding), xDomain = xlim, yDomain = ylim) n1$addParams(height = h, width = w) n1 这里xRange, xDomain这些都来自d3.js的 d3.scale.range跟 d3.scale.domain 如果没有这个相关知识,你可能很难去做这方面的调整 这个已经超出R版范围,我帮助也有限 而且我也只是之前稍微研究过d3.js,我没办法提供太多资讯
8F:推 ardodo: 感谢版主热心的分享,看来这需要学习js才能解决 07/27 13:44
9F:→ ardodo: 太感谢了!!!! 07/27 13:44
你只能期待rCharts作者可以把文件写得更加详细 让R使用者不必知道js也可以做 ※ 编辑: celestialgod (123.205.27.107), 07/27/2015 13:49:28







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:Gossiping站内搜寻

TOP