楼主: cbw1243
44348 504

[问答] 接受各种R语言难题   [推广有奖]

241
jiandong4388 学生认证  发表于 2016-7-23 11:54:46 来自手机
大神,能否指导一下。用semplot的模块画出plspm模块下的pls的结构方程模型。一直没有解决。

242
zhou1_20 发表于 2016-7-23 12:48:10
大神,这个问题怎么解决,为什么y[4]==0.15,显示为FALSE
捕获.PNG
已有 1 人评分论坛币 收起 理由
jiangbeilu + 10 鼓励积极发帖讨论

总评分: 论坛币 + 10   查看全部评分

243
1229784736 学生认证  发表于 2016-7-23 12:54:17
R语言读入中文数据用“UTF-8”读进去乱码,但是换成“UTF-”却不乱码了,这是为什么?

数据为(存为aa.txt):
          买家昵称       下单时间
1       芭可儿2009      2015/3/19
2      suspector08       2011/9/16
3    123我要买衣服     2015/3/18
4         yumengyy       2011/9/16
5        y原应叹息         2015/3/19
6 zhangwenjuan9090  2015/3/19

dat <- read.table("aa.txt",header = T,encoding = "UTF-8");head(dat)  #乱码
dat <- read.table("aa.txt",header = T,encoding = "UTF-");head(dat)  #不乱码

更换其他数据试验多次,确实都不乱码。

244
keteyewa 发表于 2016-7-23 14:37:39
用R模拟经营沙盘如何编写语言

245
cbw1243 发表于 2016-7-23 23:39:56
zhou1_20 发表于 2016-7-23 12:48
大神,这个问题怎么解决,为什么y[4]==0.15,显示为FALSE
?'=='
"For numerical and complex values, remember == and != do not allow for the finite representation of fractions, nor for rounding error. Using all.equal with identical is almost always preferable."

identical(all.equal(y[4],0.15), TRUE)  # TRUE

已有 1 人评分论坛币 收起 理由
jiangbeilu + 10 精彩帖子

总评分: 论坛币 + 10   查看全部评分

246
cbw1243 发表于 2016-7-23 23:43:27
yaqiku 发表于 2016-7-21 15:21
请问一下R语言做直方图可以做横向的吗,如果可以代码是什么,最好有个小例子~~
建议用ggplot2包,然后用下面的函数
coord_flip()

247
cbw1243 发表于 2016-7-23 23:45:12
lxy_yf 发表于 2016-7-20 15:45
本人是R的菜鸟,有个问题请教大神。就是如何建立不规则时间序列对象,            
     日期         收盘 ...
as.Date()

248
cbw1243 发表于 2016-7-23 23:54:49
verbatim 发表于 2016-7-21 10:04
d1 = structure(list(ID = c(118L, 115L, 194L, 7L, 747L)), .Names = "ID", row.names = c(NA,
-5L), cl ...
The "merge" function is to match one element at a time. That is why you see "7L" as it is the first element in "d1". You can either change the order of "d1" before merging or change the order of "demo" in the end, by using "order" function.
See details by inputing "?order'

249
cbw1243 发表于 2016-7-23 23:56:13
keym86 发表于 2016-7-21 10:04
想根据最新一天的热度大小排序
先把最后一天的数据抓出来,然后在ggplot里的aes里假如 order = “”

250
lxy444 学生认证  发表于 2016-7-24 09:37:06
来学习一下

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 22:33