-
为什么我把ltyp=2后,出来的还是实线而不是虚线呢?查看全部
-
分类变量*数值变量的可视化: 并排箱查看全部
-
分散变量的可视化:<br> (1)单变量:频率表、条形图<br> (2)双变量:关联表(交叉表)、马赛克图 ;条形图、相对频率分段条形图查看全部
-
数值变量的可视化: (1)单变量:直方图、箱图 (2)多变量:散点图查看全部
-
数据变量的特征:<br> (1)集中趋势:均值、中位数、众数<br> (2)离散趋势:值域、方差(标准差)、四分位距查看全部
-
R中的数据类型:数值变量与分类变量查看全部
-
分析结束后,还要思考分析结果之外的可能性查看全部
-
设备种类查看全部
-
library(ggplot2) ggplot(airquality, aes(Wind, Temp))+ geom_point(aes(color = factor(Month), group = 1,alpha = 0.4, size = 5))+ geom_smooth(method = "lm", se = F, aes(group = 1))#前一个group只输出群体拟合,后一个控制再做一条群体拟合 ggplot(airquality, aes(Wind, Temp)) + geom_point()+ geom_smooth(method = "lm", se = F, aes(group = 1)) ggplot(airquality, aes(Wind, Temp, col = factor(Month))) + geom_point()+ geom_smooth(method = "lm", se = F, aes(group = 1))+ scale_color_manual("Month", values = myColors)+ facet_grid(.~Month)+ theme_classic()查看全部
-
library(ggplot2) qplot(Wind, Temp, data = airquality, col = Month, shape = Month, size = Month, xlab = "Wind(mph)", ylab = "Temperature", main = "Wind vs.Temperature" ) qplot(Wind, Temp, data = airquality, geom = c("point", "smooth")) qplot(Wind, Temp, data = airquality, facets = Month~.) qplot(Wind, Temp, data = airquality, facets = .~Month) qplot(Wind, data = airquality, facets = .~Month) qplot(Wind, data = airquality, fill = Month) qplot(Wind, data = airquality, geom = "dotplot")查看全部
-
#ggplot2绘图系统 #层(layer) #绘图函数:qplot() #ggplot():ggplot2核心,依靠创建层来绘图.查看全部
-
Layer(层)查看全部
-
library(lattice) xyplot(Temp ~ Ozone, data = airquality) airquality$Month <- factor(airquality$Month) xyplot(Temp ~ Ozone | Month, data = airquality, layout = c(5,1)) q <- xyplot(Temp ~ Wind, data = airquality) print(q) set.seed(1) x <- rnorm(100) f <- rep(0:1, each=50) y <- x + f - f * x + rnorm(100, sd=0.5)#使用随机数时,切记使用种子,保证后期检查,纠错方便. f <- factor(f, labels = c("Group1", "Group2")) xyplot(y ~ x | f, layout = c(2, 1)) xyplot(y ~ x | f, panel = function(x,y){ panel.xyplot(x,y) panel.abline(v = mean(x), h = mean(y), lty = 2) panel.lmline(x,y, col = "red") })查看全部
-
#Lattice绘图系统 #xyplot/bwplot/histgram/stripplot/dotplot/splom/levelplot/contourplot #格式:xyplot(y ~ x|f * g, data) #panel,用来控制每个面板内的绘图 #lattice和Base的重要区别 #Base绘图函数直接在图形设备上绘图 #Lattice绘图函数返回trellis类对象 # 打印函数真正执行了在设备上绘图 # 命令执行时, trellis类对象会被自动打印.查看全部
-
#全局参数 par("bg")#背景颜色 par("col")#颜色 par("mar")#(bottom,left,right, right) par("mfrow") par("mfcol") par(mfrow = c(1,2)) hist(airquality$Temp) hist(airquality$Wind) par(mfrow = c(1,1)) boxplot(airquality$Temp)查看全部
举报
0/150
提交
取消