相关疑难解决方法(0)

如何将外部图例添加到ggpairs()?

我正在使用绘制散点图矩阵ggpairs.我使用以下代码:

# Load required packages
require(GGally)

# Load datasets
data(state)
df <- data.frame(state.x77,
                 State = state.name,
                 Abbrev = state.abb,
                 Region = state.region,
                 Division = state.division
) 
# Create scatterplot matrix
p <- ggpairs(df, 
             # Columns to include in the matrix
             columns = c(3,5,6,7),

             # What to include above diagonal
             # list(continuous = "points") to mirror
             # "blank" to turn off
             upper = "blank",
             legends=T,

             # What to include below diagonal
             lower = list(continuous = "points"),

             # What to …
Run Code Online (Sandbox Code Playgroud)

plot r ggally

11
推荐指数
2
解决办法
3896
查看次数

标签 统计

ggally ×1

plot ×1

r ×1