尝试按照此处制作的示例,我正在复制以下代码:
# 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 include in the diagonal
diag = list(continuous = "density"),
# How to label inner plots
# internal, none, show
axisLabels = "none",
# Other aes() parameters
colour = "Region",
title = "State Scatterplot Matrix"
)
# Show the plot
print(p)
我应该为每个情节获得一个带有图例的图像。
但相反,我得到了一个没有任何传说的人。
为什么我得到的图像没有图例的任何提示?我的特殊情况需要它们!
我正在使用 R v. 3.2.2,并在 RStudio 和 RGui 中都进行了尝试。
提前致谢!