博客总目录,记录学习R与数据分析的一切:http://www.cnblogs.com/weibaar/p/4507801.html  --- 好久没发博客 且容我大吼一句 终于做完这周R Programming的作业了! 之前一直有报coursera的课程,但是总是没有坚持下去,这次收到他们的邮件推广,说data science系列课程开通了R语言的中文课程,有中文版论坛,有中文字幕,如此诚意满满,再不报名,就实在太落伍了. 为了让自己坚持,还花钱买了signature track,所以当这周五…
完成R Programming第三周 这周作业有点绕,更多地是通过一个缓存逆矩阵的案例,向我们示范[词法作用域 Lexical Scopping]的功效.但是作业里给出的函数有点绕口,花费了我们蛮多心思. Lexical Scopping: The value of free variables are searched for in the environment where the function was defined. 因此 make.power<-function(n){ pow<…
博客总目录,记录学习R与数据分析的一切:http://www.cnblogs.com/weibaar/p/4507801.html  ------- 经过周末一个半天的努力,终于把这次的Assignment3做出来,然后做完Quiz4,顺利结束R Programming这门课程. 对这门课的综合吐槽就是,Roger老师的github头像好帅,动态视频更帅,视频内容还算充足,但远远不足以应付assignment.Assignment设计一个比一个精巧,难度一个比一个大,没有足够的耐性以及一定的基础…
这是原帖 http://www.reddit.com/r/programming/comments/358tnp/five_programming_problems_every_software_engineer/ 后来作者被人发现他自己给的solution是错的,然后有人调侃他自己应该通不过自己的面试. http://www.reddit.com/r/programming/comments/35cr6n/real_programmers_can_do_these_problems_easil…
Introduction For this first programming assignment you will write three functions that are meant to interact with dataset that accompanies this assignment. The dataset is contained in a zip file specdata.zip that you can download from the Coursera we…
Looping on the Command Line Writing for, while loops is useful when programming but not particularly easy when working interactively on the command line. There are some functions which implement looping to make life easier lapply: Loop over a list an…
在上一篇中我们一起学习了R语言的数据结构第一部分:向量.数组和矩阵,这次我们开始学习R语言的数据结构第二部分:数据框.因子和列表. 一.数据框 类似于二维数组,但不同的列可以有不同的数据类型(每一列内的数据类型应当一致).创建数据框使用的关键字是data.frame,用法是: data.frame(..., row.names = NULL, check.rows = FALSE, check.names = TRUE, fix.empty.names = TRUE, stringsAsFact…
R是免费开源的软件,具有强大的数据处理和绘图等功能.下面是R开发环境的搭建过程. 一.点击网址 https://www.r-project.org/ ,进入"The R Project for Statistical Computing"界面. 二.点击加粗字体的"download R",进行"CRAN Mirrors"镜像选择页面. 三.下拉滚动条,找到 从中选择镜像网址,这里点击第二项. 四.在界面下选择"Download R fo…
Warning message: In ks.test(x, y) : p-value will be approximate in the presence of ties   The warning messages are due to the implementation of the KS test in R, which expects a continuous distribution and thus there should not be any identical value…
library(datasets) head(airquality) #按月分組 s <- split(airquality, airquality$Month) str(s) summary(s) lapply(s,function(x) colMeans(x[,c("Ozone","Solar.R","Wind")],na.rm = T)) sapply(s,function(x) colMeans(x[,c("Ozone&q…