![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
R
文章平均质量分 73
岁月催猪老
上年纪菜鸟一枚。欢迎交流。
展开
-
R:文本挖掘学习笔记1 - tm Package
1. 文件读取和查看DirSource()Corpus()inspect()tm 提供五种资源读取的方式:> getSources()[1] "DataframeSource" "DirSource" "URISource" "VectorSource" "XMLSource" 仅就.txt文件而言,学习初期常用的是直原创 2015-01-06 14:02:30 · 11128 阅读 · 0 评论 -
R: 矩阵运算及常用函数 I - split
R有一个非常强大的向量计算的方式,可以避免控制流循环带来的高错误率以及漫长的响应时间。这里就涉及到一个数据转换的模式:split-apply-combine (图简单,接下来都简称SAC了)。大神曾就这个模式开发出了plyr包,并写了一篇文章叫The Split-Apply-Combine Strategy for Data Analysis. 有兴趣不妨一读。下面写的是我原创 2014-11-26 17:04:03 · 6105 阅读 · 0 评论 -
R: 矩阵运算及常用函数 IV - *apply Part II
*apply的Part I 提到了apply, tapply, by, eapply四个函数,接下来我们看看剩下的几个。主要参数X和FUN的用法跟之前Part I里都差不多。-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-1. lapply系列函数1. 1原创 2014-12-01 18:54:48 · 1243 阅读 · 0 评论 -
R: 向量 vs. 数组 vs. 矩阵 vs. 数据框 vector vs. array vs. matrix vs. data.frame
在读R Document的时候经常会出现array这个词。array字面上很好理解,数组,但是数组跟矩阵、跟数据框(包括向量)有什么区别呢?-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-在C语言里(R就是基于C写出来的)也有数组这个概念,它是具有相同数据类型按原创 2014-12-02 14:51:14 · 6314 阅读 · 0 评论 -
R: 矩阵运算及常用函数 V - plyr Part I
plyr是莱斯大学的Hardley Wickham大神的杰作之一(如果你没听说过这个人——ggplot也是他开发的。。。),他以split - apply - combine (SAC)的模式和理念自己写了这么一个函数包。plyr函数系列的命名方式很简单,后缀-ply是通用名,前缀分两个部分,第一个字母是input的数据结构,第二个字母是output的数据结构。一共有六种input和out原创 2014-12-10 15:54:59 · 1098 阅读 · 0 评论 -
R: RStudio的中文读取、保存与显示
做中文文本挖掘的时候经常要读取中文网站上的信息,但英文系统RStudio在WINDOWS系统下有无法完全兼容中文字符,所以print到显示器上的中文字符统统是乱码。处理方法如下:首先修改系统语言:Control Panel -> Region and Language -> Formats -> Chinese (Simplified, PRC)Control Panel -> R原创 2015-01-16 14:44:08 · 22666 阅读 · 0 评论 -
Updating R from R (on Windows) – using the {installr} package
原文见此Upgrading R on Windows is not easy. While the R FAQ offer guidelines, some users may prefer to simply run a command in order to upgrade their R to the latest version. That is what then转载 2015-03-09 15:28:54 · 769 阅读 · 0 评论 -
Learning Time Series with R
by Joseph Rickert 原文地址Late last Saturday afternoon I was reading in my usual spot at the Dana Street Coffee House in Mt. View. A stranger walking by my table noticed my copy of Madsen’sTime Seri转载 2015-03-11 17:33:01 · 1242 阅读 · 0 评论 -
R版本更新 - installr包
很久没有更新R,但是又想去R的官网上去看有没有版本更新,怎么办?install.packages("installr")require(installr)这两行命令可以在RStudio或者R上运行。installr包有一系列的函数updateR, install.R, install.RStudio, install.Rtools, install.pandoc, install.原创 2015-03-11 18:47:46 · 16358 阅读 · 0 评论 -
R: 如何理解变量和环境的Lexical Scoping Rule
非IT出身,看到Scoping Rule神马的是非常头疼的,尤其是需要涉及到Function的嵌套的时候,很容易将不同environment种的变量弄混淆,还是自己动手实践一下比较好。在一个Function中,对一个变量的lexical scoping rule的检索次序是,先检查本Function中的environment,如果能找到该变量,则返回该变量,如果不能,则检索这个Function原创 2015-04-21 11:01:38 · 3917 阅读 · 0 评论 -
data.table Way - Learning Note Part 2
We resume the learning note.原创 2015-09-25 21:01:20 · 1676 阅读 · 0 评论 -
R Markdown Review
Quoting the introduction on RStudio official site:R Markdown is an authoring format that enables easy creation of dynamic documents, presentations, and reports from R.原创 2015-10-02 19:23:28 · 1522 阅读 · 0 评论 -
R Package ggvis Flashback
ggvis is an awesome data visualization package which builds data graphics with a syntax similar to ggplot2 and creates rich interactive plots like shiny.原创 2015-10-07 22:49:58 · 1672 阅读 · 0 评论 -
Scraping Data Table from Website by R
For many quantitative analysis, we often consider factors such climate or economics data. Those data are usually displayed as tables on the websites and can be collected from there.原创 2015-09-23 21:38:47 · 1190 阅读 · 0 评论 -
Install R and RStudio on Ubuntu
I wanted to try Linux system thus I formatted an old laptop bought 7 years ago (HP Pavilion dm3, French keyboard).原创 2015-09-23 21:40:47 · 1405 阅读 · 0 评论 -
R: 矩阵运算及常用函数 III - *apply Part I
在”向量运算及常用函数I“里已经提到过,apply系列函数“主要用于某维度上某函数/方法的批量应用”,可以避免“控制流循环带来的高错误率以及漫长的响应时间”。为了比较响应时间,我们可以先做一个简单的测试:为一列数据做一一系列幂的变形,依据指数的sequence,生成一系列的新数据。然后用system.time()来测试运行的时间(如何解读system.time()结果)。test1原创 2014-11-28 16:51:41 · 1037 阅读 · 0 评论 -
R: 矩阵运算及常用函数 II - aggregate
aggregate也是跟SAC有关系的一个函数(stats包中):先将对象分解为不同的组别(回忆一下split函数),然后分个处理,最后合并显示。具体地说,aggregate()函数将数据集(依据指定方法)拆分成不同子集,分别计算各自的统计数据,并(组合)返回计算结果。此函数一般对三种对象做处理:data.frame, formula 和 ts (即时间序列).参考EXCEL的原创 2014-11-26 17:05:12 · 7925 阅读 · 1 评论 -
控制语句 VBA vs. R vs. Python (1) if...语句
IF的应用及对比例:顶上战争后,如果罗没有就路飞,则路飞死去,反之,路飞活着;如果之后雷利找到了路飞,则路飞在接下来的两年内学会霸气,反之,两年后进入新世界,草帽团团灭。VBA:If Law_Saved_Luffy = False Then Luffy == "Dead!"ElseIf Raily_Found_Luffy = True Then Luffy = "NewS原创 2014-03-07 20:58:13 · 1377 阅读 · 0 评论 -
R: 循环语句中warning()的显示问题
以下是我一个自定义函数的一段内容原创 2014-07-16 15:29:33 · 10105 阅读 · 0 评论 -
Statistical Language Wars: The Infograph
Source: blog.datacamp.com转载 2014-07-21 18:20:50 · 789 阅读 · 0 评论 -
用阶乘函数factorial()求排列组合之和
前段时间要做一个模型,初始原创 2014-06-11 12:03:21 · 4157 阅读 · 1 评论 -
R转换.csv文件格式到.txt或.xlsx) [read.csv and export data to .txt or .xlsx]
现有多份文件名相似的.csv格式文件原创 2014-04-16 18:36:22 · 8948 阅读 · 0 评论 -
Rmarkdown / knitr WINDOWS 系统下中文显示
WINDOWS系统下,用Rmarkdown无法直接将中文zhu原创 2014-07-04 17:17:26 · 5615 阅读 · 0 评论 -
R: 控制台的清理与输出内容的保存 (Clear Console & Save Console Output)
控制台原创 2014-07-30 10:12:42 · 34675 阅读 · 3 评论 -
R: anova或linear model 的 MAPE计算
在R的summary()基本功能里,对“lm"huoz原创 2014-08-07 12:01:37 · 9830 阅读 · 0 评论 -
R: 数据排序函数 sort(), rank(), order()
目前接触到原创 2014-08-25 10:03:58 · 3718 阅读 · 0 评论 -
R: 如何批量安装R包 (R packages installation in bulk)
写自定义函数的时候常常会遇到一次性需要导入很多原创 2014-11-18 19:03:10 · 8579 阅读 · 0 评论 -
R: 使用source()函数引用网络数据文件时,系统适配性问题
source()常见于引用本地文件或者网络文件。引用网络文件的常见案例为原创 2014-11-18 19:34:08 · 3861 阅读 · 0 评论 -
R: 字符查询匹配和替换 grep(...) - Pattern Matching and Replacement
R语言中文本处理的重要一环,而R里面最强大的文本处理公式就是grep()一类的general函数(无需添加任何新的package)。grep的全称是global search regular expression and print out the line,是Unix下一种强大的文本搜索工具,可以通过正则表达式搜索文本,并把匹配的行打印出来[1]。-+--+--+--+--+--原创 2014-11-25 16:57:02 · 35430 阅读 · 0 评论 -
data.table Way - Learning Note Part 1
This is a learning note for the course Data Analysis in R, the data.table Way. This course introduces the package ‘data.table’ which is a very powerful tool for data manipulation. I borrow two built-i原创 2015-09-23 21:42:12 · 1963 阅读 · 0 评论