scatterplotMatrix()函数 再来一个scatterplotMatrix()函数的使用例子,主对角线的核密度曲线改为了直方图,并且直方图以汽车气缸数为条件绘制。 library(car) scatterplotMatrix(~ mpg + disp + drat + wt|cyl, data=mtcars, spread=FALSE, diagonal=“histogram”, main=“Scatter Plot Matrix via car Package”)...
pairs(tips[,1:3]) #使用car包中的scatterplot.matrix()函数 library(car) scatterplot.matrix(tips[,1:3]) #使用GGally包中的ggpairs()函数绘制散点图矩阵 library(GGally) ggpairs(tips[, 1:3]) 通过GGally包中的ggpairs()函数绘制散点图矩阵还是非常引入入目的,将连续变量和离散变量非常完美的结合在...
library(car) scatterplot.matrix(tips[,1:3]) #使用GGally包中的ggpairs()函数绘制散点图矩阵 library(GGally) ggpairs(tips[, 1:3]) 通过GGally包中的ggpairs()函数绘制散点图矩阵还是非常引入入目的,将连续变量和离散变量非常完美的结合在一起。 参考资料: R语言_ggplot2:数据分析与图形艺术 R...
pairs(tips[,1:3]) #使用car包中的scatterplot.matrix()函数 library(car) scatterplot.matrix(tips[,1:3]) #使用GGally包中的ggpairs()函数绘制散点图矩阵 library(GGally) ggpairs(tips[, 1:3]) 通过GGally包中的ggpairs()函数绘制散点图矩阵还是非常引入入目的,将连续变量和离散变量非常完美的结合在...
library(cowplot) plot_grid(plot_grid(g, p1), p2, ncol = 1) # 首先将g和p1横向组合在一起,得到的图形再跟p2纵向组合(ncol=1) 2.3 gridExtra 包 library(gridExtra) grid.arrange(g, p1, p2, layout_matrix = rbind(c(1, 2), c(3, 3))) 这里的123分别代表前面的3个图形g,p1和p2,而layout...
qplot(): Quick plot with ggplot2 Scatter plots Bar plot Box plot, violin plot and dot plot Histogram and density plots Box plots Basic box plots Box plot with dots Change box plot colors by groups Change box plot line colors Change box plot fill colors ...
GGally:GGallyextends ggplot2 for visualizingcorrelation matrix,scatterplot plot matrix,survival plotand more. ggRandomForests: Graphical analysis ofrandom forestswith the randomForestSRC and ggplot2 packages. ggdendro: Create dendrograms and tree diagrams using ggplot2 ...
#最大的size设置为15,其它的从12依次往下降 # Making a scatter plot matrix c2009 <- subset(countries, Year = 2000, select = c(Name,GDP,laborrate, healthexp,infmortality)) plot(c2009[,2:5]) #或者用pairs(), 即pairs(c2009[,2:5]), 效果一致...
scatterplot.matrix(tips[,1:3]) #使用GGally包中的ggpairs()函数绘制散点图矩阵 library(GGally) ggpairs(tips[, 1:3]) 通过GGally包中的ggpairs()函数绘制散点图矩阵还是非常引入入目的,将连续变量和离散变量非常完美的结合在一起。 参考资料: ...
可以实现相关图的包,包括GGally的ggpairs,corrgram,ellipse,以及car包中的scatterplotMatrix()以及原生plot()都可以实现类似的效果ggpairs官方文档:https://ggobi.github.io/ggally/articles/ggpairs.html image library(GGally)library(ggplot2)data(flea)ggpairs(flea,columns=2:4,ggplot2::aes(colour=species))...