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…
par(ask=TRUE) opar <- par(no.readonly=TRUE) # make a copy of current settings attach(mtcars) # be sure to execute this line plot(wt, mpg) abline(lm(mpg~wt)) title("Regression of MPG on Weight") # Input data for drug example dose <- c(20, 3…
在数据分析中,对缺失值的处理是很关键一步,一般用summary()函数 a<-c(,,,NA) B<-c("a","b","c","D") d<-data.frame(a,B) summary(d) a B Min. : 1st Qu.: Median : Mean : 3rd Qu.:2.5 Max. :3.0 NA's :1 但通过R语言的VIM包的aggr函数可以做缺失值的图形化展示: library(…