Examples for 'GGally::ggmatrix_location'


'ggmatrix' plot locations

Aliases: ggmatrix_location

Keywords:

### ** Examples

pm <- ggpairs(reshape::tips, 1:3)

# All locations
ggmatrix_location(pm, location = "all")
  row col
1   1   1
2   2   1
3   3   1
4   1   2
5   2   2
6   3   2
7   1   3
8   2   3
9   3   3
ggmatrix_location(pm, location = TRUE)
  row col
1   1   1
2   2   1
3   3   1
4   1   2
5   2   2
6   3   2
7   1   3
8   2   3
9   3   3
# No locations
ggmatrix_location(pm, location = "none")
[1] row col
<0 rows> (or 0-length row.names)
# "upper" triangle locations
ggmatrix_location(pm, location = "upper")
  row col
4   1   2
7   1   3
8   2   3
# "lower" triangle locations
ggmatrix_location(pm, location = "lower")
  row col
2   2   1
3   3   1
6   3   2
# "diag" locations
ggmatrix_location(pm, location = "diag")
  row col
1   1   1
5   2   2
9   3   3
# specific rows
ggmatrix_location(pm, rows = 2)
  row col
1   2   1
2   2   2
3   2   3
# specific columns
ggmatrix_location(pm, cols = 2)
  row col
1   1   2
2   2   2
3   3   2
# row and column combinations
ggmatrix_location(pm, rows = c(1,2), cols = c(1,3))
  row col
1   1   1
2   2   1
3   1   3
4   2   3
# matrix locations
mat <- matrix(TRUE, ncol = 3, nrow = 3)
mat[1,1] <- FALSE
locs <- ggmatrix_location(pm, location = mat)
## does not contain the 1,1 cell
locs
  row col
1   1   2
2   1   3
3   2   1
4   2   2
5   2   3
6   3   1
7   3   2
8   3   3
# Use the output of a prior ggmatrix_location
ggmatrix_location(pm, location = locs)
  row col
1   1   2
2   1   3
3   2   1
4   2   2
5   2   3
6   3   1
7   3   2
8   3   3

[Package GGally version 2.1.2 Index]