我正在使用R 3.1和RStudio 0.99运行矩阵.
我有我的R脚本和cmd +输入它没有问题.
我为报告创建了一个Rmd,但是我有这个错误
Error in lazyLoadDBinsertVariable(vars[i], from, datafile, ascii, compress, :
long vectors not supported yet: ../../../../R-3.3.1/src/main/connections.c:5600
Calls: <Anonymous> ... <Anonymous> -> <Anonymous> -> lazyLoadDBinsertVariable
Execution halted
Run Code Online (Sandbox Code Playgroud)
有没有办法绕过这个错误?
但不同之处在于,这仅在尝试创建Rmd时发生,而不是在任何其他情况下
由于谷歌字体在中国被屏蔽,我不得不下载它们并使用FontSquirrel进行转换.
问题:fi/ff /等很难看
我在这里做了所有的步骤通过CSS防止Safari(Mavericks/iOS7)中的连字,但没有雪茄.
如何一次禁用连字?
-webkit-font-variant-ligatures: no-common-ligatures;
不行
我正在阅读许可证.什么样的许可证是R套餐的最佳许可证?
我很喜欢Creative Commons,但不推荐用于软件.他们自己的网站说:"我们建议不要使用Creative Commons许可软件." (来源:https://creativecommons.org/faq/#can-i-apply-a-creative-commons-license-to-software)
我想知道给我的R包提供CC 4.0许可证是否违反R良好做法.我没有找到有关此特定主题的信息.
我正在使用dplyr并gsub删除特殊字符.我正在尝试翻译我用基础R的代码.
这是一个类似我的数据的假例子:
region = c("regi\xf3n de tarapac\xe1","regi\xf3n de tarapac\xe1")
provincia = c("cami\xf1a","iquique")
comuna = c("tamarugal","alto hospicio")
comunas = cbind(region,provincia,comuna)
Run Code Online (Sandbox Code Playgroud)
这对我有用:
comunas = comunas %>%
mutate(comuna = gsub("\xe1", "\u00e1", comuna), # a with acute
comuna = gsub("<e1>", "\u00e1", comuna) # a with acute
)
Run Code Online (Sandbox Code Playgroud)
但现在我想将相同的内容应用于每一列:
comunas = comunas %>%
mutate_all(funs(gsub("\xe1", "\u00e1", .), # a with acute
gsub("<e1>", "\u00e1", .) # a with acute
))
Run Code Online (Sandbox Code Playgroud)
我看到最后一个块没有效果.想法是获得:
region provincia comuna
[1,] "regi\xf3n de tarapacá" "cami\xf1a" "tamarugal"
[2,] "regi\xf3n de …Run Code Online (Sandbox Code Playgroud) 我看到这些帖子 GGally :: ggpairs绘图没有网格线时绘制相关系数 使用ggpairs来创建这个图
阅读后,我能够实现这个黑客https://github.com/tonytonov/ggally/blob/master/R/gg-plots.r,我的情节看起来像这样
我认为这是一个很好的结果,但我无法改变颜色.
MWE就是这个
library(ggally)
# load the hack
source("ggally_mod.R")
# I saved https://github.com/tonytonov/ggally/blob/master/R/gg-plots.r as "ggally_mod.R"
assignInNamespace("ggally_cor", ggally_cor, "GGally")
ggpairs(swiss)
Run Code Online (Sandbox Code Playgroud)
现在我想跑
ggpairs(swiss,
lower=list(continuous="smooth", wrap=c(colour="blue")),
diag=list(continuous="bar", wrap=c(colour="blue")))
Run Code Online (Sandbox Code Playgroud)
但颜色保持不变.有没有办法改变颜色,因为params不再工作了?
我有一个370MB的zip文件,内容是4.2GB的csv文件.
我做了:
unzip("year2015.zip", exdir = "csv_folder")
Run Code Online (Sandbox Code Playgroud)
我收到了这条消息:
1: In unzip("year2015.zip", exdir = "csv_folder") :
possible truncation of >= 4GB file
Run Code Online (Sandbox Code Playgroud)
你以前经历过吗?你是怎么解决的?
我正在使用D3Plus,D3Plus接受任何D3方法.
我可以设法删除小数.我不能做的是添加'.' 作为一个千分词而不是','(西班牙语1.000.000是'一百万')这是一个讲西班牙语的观众.
这是我的代码的相关部分
"number": function(number, params) {
var formatted = d3plus.number.format(number, params);
if (params.key === "encuentros") {
return d3.round(number,0);
}
if (params.key === "poblacion") {
return d3.round(number,0);
}
else {
return formatted;
}
}
Run Code Online (Sandbox Code Playgroud)
我尝试过,return d3.round(number,0) + d3.format('.')但这不起作用.
图表是"ok"但没有小数点分隔符.
我创建了一个 R 包,我想提交给 CRAN。它包含需要用普通 C 编译的代码,并且此代码依赖于libxml2库。
我目前的解决方案是让 Linux 和 Mac 用户安装该libxml2-dev包,让他们编译和安装 R 源包。
对于 Windows,我创建了一个特殊的二进制 R 包,其中包含所需的二进制依赖项。在阅读 CRAN 指南时,我看到只能上传源包,并且它们可能不包含任何二进制文件。
在这些指导方针之后,我的问题是:
我有一个包含 10 列的数据框。例如,这是虚拟版本:
df = tbl_df(replicate(10,sample(0:1,1000,rep=TRUE)))
Run Code Online (Sandbox Code Playgroud)
我想在 dplyr 中做到这一点:
df %>% mutate(V2 = ifelse(is.na(V6), V2, paste(V2,V3,sep=" ")))
Run Code Online (Sandbox Code Playgroud)
我获得:
Error: Each variable must have a unique name.
Run Code Online (Sandbox Code Playgroud)
但如果我这样做:
df$V2 = ifelse(is.na(df$V6), df$V2, paste(df$V2,df$V3,sep=" "))
Run Code Online (Sandbox Code Playgroud)
有用。
我怎样才能用dplyr语句做最后一步?
我在做使用R.文本分析有没有办法删除所有的话不是在盖使用tm或stringi?
如果我有这样的事情
Albert Einstein went to the store and saw his friend Nikola Tesla ... + 200 pags
Run Code Online (Sandbox Code Playgroud)
被转换成
Albert Einstein Nikola Tesla
Run Code Online (Sandbox Code Playgroud)
最好的祝福