Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions tests/testthat/_snaps/crosstalk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# crosstalk works with ggduo and ggpairs

Code
ggpairs(sd, 3:5)
Condition
Error in `fix_column_values()`:
! Make sure your numeric "columns" values are less than or equal to 4.
* columns = c(3, 4, 5)

---

Code
ggpairs(sd, c("Petal.Length", "Petal.Width", crosstalk_key()))
Condition
Error in `fix_column_values()`:
! Columns in `columns` not found in data: `'.crossTalkKey'`.
i Choices: `Sepal.Length`, `Sepal.Width`, `Petal.Length`, and `Petal.Width`

---

Code
ggduo(sd, c(1:2, 5), 3:5)
Condition
Error in `fix_column_values()`:
! Make sure your numeric "columnsX" values are less than or equal to 4.
* columnsX = c(1, 2, 5)

---

Code
ggduo(sd, c("Sepal.Length", "Sepal.Width", crosstalk_key()), c("Petal.Length",
"Petal.Width"))
Condition
Error in `fix_column_values()`:
! Columns in `columnsX` not found in data: `'.crossTalkKey'`.
i Choices: `Sepal.Length`, `Sepal.Width`, `Petal.Length`, and `Petal.Width`

---

Code
ggduo(sd, c("Sepal.Length", "Sepal.Width"), c("Petal.Length", "Petal.Width",
crosstalk_key()))
Condition
Error in `fix_column_values()`:
! Columns in `columnsY` not found in data: `'.crossTalkKey'`.
i Choices: `Sepal.Length`, `Sepal.Width`, `Petal.Length`, and `Petal.Width`

16 changes: 16 additions & 0 deletions tests/testthat/_snaps/gg-plots.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# cor

Code
ggally_cor(ti, ggplot2::aes(x = total_bill, y = tip, color = size))
Condition
Error in `ggally_statistic()`:
! `mapping` color column must be categorical, not numeric

# diagAxis

Code
ggally_diagAxis(iris, mapping = ggplot2::aes(y = Sepal.Length))
Condition
Error in `ggally_diagAxis()`:
! mapping$x is null. There must be a column value in this location.

16 changes: 16 additions & 0 deletions tests/testthat/_snaps/ggcorr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# further options

Code
ggcorr(flea[, -1], layout.exp = "a")
Condition
Error in `ggcorr()`:
! incorrect `layout.exp` value

# other geoms

Code
ggcorr(flea[, -1], geom = "hexbin")
Condition
Error in `ggcorr()`:
! incorrect geom value

81 changes: 81 additions & 0 deletions tests/testthat/_snaps/ggmatrix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# stops

Code
ggmatrix(plots = matrix(), nrow = 2, ncol = 3)
Condition
Error in `ggmatrix()`:
! `plots` must be a `list()`

---

Code
ggmatrix(plots = list(), nrow = "2", ncol = 3)
Condition
Error in `check_nrow_ncol()`:
! `nrow` must be a numeric value

---

Code
ggmatrix(plots = list(), nrow = 2, ncol = "3")
Condition
Error in `check_nrow_ncol()`:
! `ncol` must be a numeric value

---

Code
ggmatrix(plots = list(), nrow = c(2, 3), ncol = 3)
Condition
Error in `check_nrow_ncol()`:
! `nrow` must be a single numeric value

---

Code
ggmatrix(plots = list(), nrow = 2, ncol = c(2, 3))
Condition
Error in `check_nrow_ncol()`:
! `ncol` must be a single numeric value

# expression labels

Code
print(ggpairs(tips, 1:2, columnLabels = expression(alpha, beta)))
Condition
Error in `get_labels()`:
! `xAxisLabels` can only be a character vector or `NULL`.
i Character values can be parsed using the `labeller` parameter.

# blank

Code
pm[2, 2] <- "not blank"
Condition
Error in `putPlot()`:
! character values (besides `'blank'`) are not allowed to be stored as plot values.

# ggmatrix proportions

Code
ggmatrix_proportions("not auto", tips, 1:ncol(tips))
Condition
Error in `ggmatrix_proportions()`:
! `proportions` need to be non-NA numeric values or `'auto'`. proportions: "not auto"

---

Code
ggmatrix_proportions(NA, tips, 1:ncol(tips))
Condition
Error in `ggmatrix_proportions()`:
! `proportions` need to be non-NA numeric values or `'auto'`. proportions: NA

---

Code
ggmatrix_proportions(c(1, NA, 1, 1, 1, 1, 1), tips, 1:ncol(tips))
Condition
Error in `ggmatrix_proportions()`:
! `proportions` need to be non-NA numeric values or `'auto'`. proportions: c(1, NA, 1, 1, 1, 1, 1)

9 changes: 9 additions & 0 deletions tests/testthat/_snaps/ggmatrix_add.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# add

Code
pm + 3
Condition
Error in `+.ggmatrix`:
! `ggmatrix()` does not know how to add objects that do not have class <theme>, <labels> or <ggproto>.
i Received object with class: <numeric>

# v1_ggmatrix_theme

Code
Expand Down
73 changes: 73 additions & 0 deletions tests/testthat/_snaps/ggmatrix_getput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# stops

Code
pm["total_bill", 1]
Condition
Error in `check_i_j()`:
! `i` may only be a single numeric value

---

Code
pm[1, "total_bill"]
Condition
Error in `check_i_j()`:
! `j` may only be a single numeric value

---

Code
pm["total_bill", 1] <- p
Condition
Error in `check_i_j()`:
! `i` may only be a single numeric value

---

Code
pm[1, "total_bill"] <- p
Condition
Error in `check_i_j()`:
! `j` may only be a single numeric value

---

Code
pm[0, 1]
Condition
Error in `check_i_j()`:
! `i` may only be in the range from 1:4

---

Code
pm[1, 0]
Condition
Error in `check_i_j()`:
! `j` may only be in the range from 1:3

---

Code
pm[5, 1]
Condition
Error in `check_i_j()`:
! `i` may only be in the range from 1:4

---

Code
pm[1, 4]
Condition
Error in `check_i_j()`:
! `j` may only be in the range from 1:3

# get

Code
a[2, 1]
Condition
Error in `getPlot()`:
! unknown plot object type.
i Position: i = 2, j = 1 str(plotObj): int [1:4] 1 2 3 4

132 changes: 132 additions & 0 deletions tests/testthat/_snaps/ggmatrix_location.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# rows work

Code
ggmatrix_location(pm, rows = TRUE)
Condition
Error in `ggmatrix_location()`:
! `rows` must be numeric

---

Code
ggmatrix_location(pm, rows = "1")
Condition
Error in `ggmatrix_location()`:
! `rows` must be numeric

# cols work

Code
ggmatrix_location(pm, cols = TRUE)
Condition
Error in `ggmatrix_location()`:
! `cols` must be numeric

---

Code
ggmatrix_location(pm, cols = "1")
Condition
Error in `ggmatrix_location()`:
! `cols` must be numeric

# location character

Code
ggmatrix_location(pm, location = "unknown")
Condition
Error in `match.arg()`:
! 'arg' should be one of "all", "upper", "lower", "diag", "none"

# location matrix

Code
ggmatrix_location(pm, location = mat[, 1:6])
Condition
Error in `ggmatrix_location()`:
! `location` provided does not have the same size of columns

---

Code
ggmatrix_location(pm, location = mat[1:6, ])
Condition
Error in `ggmatrix_location()`:
! `location` provided does not have the same size of rows

---

Code
ggmatrix_location(pm, location = cbind(mat, 1))
Condition
Error in `ggmatrix_location()`:
! `location` provided does not have the same size of columns

---

Code
ggmatrix_location(pm, location = rbind(mat, 1))
Condition
Error in `ggmatrix_location()`:
! `location` provided does not have the same size of rows

---

Code
ggmatrix_location(pm, location = expand.grid(row = 1:7, col = 2:8))
Condition
Error in `ggmatrix_location()`:
! `col` must be non-NA / positive numeric values `<= pm$ncol`
* `pm$ncol`: 7
* `col`: 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, ..., 8, and 8

---

Code
ggmatrix_location(pm, location = expand.grid(row = 2:8, col = 1:7))
Condition
Error in `ggmatrix_location()`:
! `row` must be non-NA / positive numeric values `<= pm$nrow`
* `pm$nrow`: 7
* row: 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, 6, 7, 8, 2, 3, 4, 5, ..., 7, and 8

---

Code
ggmatrix_location(pm, location = expand.grid(row = 1:7, col = 0:6))
Condition
Error in `ggmatrix_location()`:
! `col` must be non-NA / positive numeric values `<= pm$ncol`
* `pm$ncol`: 7
* `col`: 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, ..., 6, and 6

---

Code
ggmatrix_location(pm, location = expand.grid(row = 0:6, col = 1:7))
Condition
Error in `ggmatrix_location()`:
! `row` must be non-NA / positive numeric values `<= pm$nrow`
* `pm$nrow`: 7
* row: 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, 4, 5, 6, 0, 1, 2, 3, ..., 5, and 6

---

Code
ggmatrix_location(pm, location = expand.grid(row = 1:7, col = c(1:6, NA)))
Condition
Error in `ggmatrix_location()`:
! `col` must be non-NA / positive numeric values `<= pm$ncol`
* `pm$ncol`: 7
* `col`: 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, ..., NA, and NA

---

Code
ggmatrix_location(pm, location = expand.grid(row = c(1:6, NA), col = 1:7))
Condition
Error in `ggmatrix_location()`:
! `row` must be non-NA / positive numeric values `<= pm$nrow`
* `pm$nrow`: 7
* row: 1, 2, 3, 4, 5, 6, NA, 1, 2, 3, 4, 5, 6, NA, 1, 2, 3, 4, ..., 6, and NA

Loading
Loading