R Programming week1-Subsetting】的更多相关文章

博客总目录,记录学习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<…
这是原帖 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…
Subsetting There are a number of operators that can be used to extract subsets of R objects. [ always returns an object of the same class as the original; can be used to select more than one element (there is one exception) [[ is used to extract elem…
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…
#Generating normal distribution (Pseudo) random number x<-rnorm(10) x x2<-rnorm(10,2,1) x2 set.seed() #Generating Poisson data rpois(10,1) rpois(10,2) rpois(10,20) ppois(2,2) #Cumulative distribution ##P r(x <= 2) 平均發生率為2 ppois(4,2) #Cumulative d…
Something’s Wrong! Indications that something’s not right message: A generic notification/diagnostic message produced by the message function;execution of the function continues warning: An indication that something is wrong but not necessarily fatal…