Parallel Coordinates

Does anyone know if there is a way to add variable labels to the ggparcoord function in GGally? I've tried numerous ways with geom_text , but nothing is yielding results.

To be more explicit, I am looking to pass the row.names(mtcars) through geom_text . The only way that I can distinguish the car is passing row.names(mtcars) through the groupColumn argument, but I don't like the way this looks.

Doesn't work:

mtcars$carName <- row.names(mtcars) # This becomes column 12
library(GGally)
# Attempt 1
ggparcoord(mtcars, 
           columns = c(12, 1, 6), 
           groupColumn = 1) +
geom_text(aes(label = carName))

# Attempt 2
ggparcoord(mtcars, 
           columns = c(12, 1, 6),
           groupColumn = 1,
           mapping = aes(label = carName))

Any ideas would be appreciated!

链接地址: http://www.djcxy.com/p/30926.html

上一篇: 从GGally中删除ggpairs的背景颜色

下一篇: 平行坐标