Skip to content

Commit 7f88a56

Browse files
Do not pass stringsAsFactors to data_frame() (#4078)
1 parent 7d05fa3 commit 7f88a56

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

tests/testthat/test-build.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ test_that("non-position aesthetics are mapped", {
4848
})
4949

5050
test_that("strings are not converted to factors", {
51-
df <- data_frame(x = 1:2, y = 2:1, label = c("alpha", "beta"), stringsAsFactors = FALSE)
51+
df <- data_frame(x = 1:2, y = 2:1, label = c("alpha", "beta"))
5252
p <- ggplot(df, aes(x, y)) +
5353
geom_text(aes(label = label), parse = TRUE)
5454

tests/testthat/test-data.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ test_that("stringsAsFactors doesn't affect results", {
44
old <- getOption("stringsAsFactors")
55
on.exit(options(stringsAsFactors = old), add = TRUE)
66

7-
dat.character <- data_frame(x = letters[5:1], y = 1:5, stringsAsFactors = FALSE)
8-
dat.factor <- data_frame(x = letters[5:1], y = 1:5, stringsAsFactors = TRUE)
7+
dat.character <- data_frame(x = letters[5:1], y = 1:5)
8+
dat.factor <- data_frame(x = letters[5:1], y = 1:5)
99

1010
base <- ggplot(mapping = aes(x, y)) + geom_point()
1111
xlabels <- function(x) x$layout$panel_params[[1]]$x$get_labels()

tests/testthat/test-position-dodge2.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ test_that("rectangles are dodged", {
4040
test_that("cols at the same x position are dodged", {
4141
df <- data_frame(
4242
x = c("a", "a", "b"),
43-
n = c(1, 5, 10),
44-
stringsAsFactors = FALSE
43+
n = c(1, 5, 10)
4544
)
4645

4746
p <- ggplot(df, aes(1, n, fill = x)) +

0 commit comments

Comments
 (0)