by 写长城的诗 • October 30, 2011 • Comments Off This post was kindly contributed by 数据科学与R语言 - go there to comment and to read the full post. 一.数据导入 对初学者来讲,面对一片空白的命令行窗口,第一道真正的难关也许就是数据的导入.数据导入有很多途径,例如从网页抓取.公共数据源获得.文本文件导入.为了快速入门,建议初学者采取R语言协同Excel电子表格的方法.也就…
par(ask=TRUE) opar <- par(no.readonly=TRUE) # record current settings # Listing 11.1 - A scatter plot with best fit lines attach(mtcars) plot(wt, mpg, main="Basic Scatterplot of MPG vs. Weight", xlab="Car Weight (lbs/1000)", ylab=&q…
#因子:分类数据#有序和无序#整数向量+标签label#Male/Female#常用于lm(),glm() > x <- factor(c("female","female","female","male"))> y <- factor(c("female","female","female","male"),levels=…