Skip to content

Characters variables inherit same default behaviour as factors#323

Merged
grantmcdermott merged 7 commits intomainfrom
points_factors
Feb 18, 2025
Merged

Characters variables inherit same default behaviour as factors#323
grantmcdermott merged 7 commits intomainfrom
points_factors

Conversation

@grantmcdermott
Copy link
Copy Markdown
Owner

Closes #321

pkgload::load_all("~/Documents/Projects/tinyplot/")
#> ℹ Loading tinyplot

set.seed(0)
x <- rep(c("A", "B", "C"), each = 20)
y <- runif(60)
gp <- sample(c("X", "Y", "Z"), size = 60, replace = TRUE)
df <- data.frame(x, y, gp)

plt(
  y ~ x | gp,
  data = df
)

I also addressed/enabled factor variable support for type_points().

plt(
  y ~ x | gp, pch = 0:2,
  data = df,
  type = type_points()
)

Note: the basic "p" type isn't working (I think b/c of #322).

plt(
  y ~ x | gp, pch = 0:2,
  data = df,
  type = "p"
)
#> Error in Summary.factor(structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, : 'range' not meaningful for factors

Created on 2025-02-17 with reprex v2.1.1

@grantmcdermott
Copy link
Copy Markdown
Owner Author

(Will add NEWS etc. later tonight. Dinner time first.)

@grantmcdermott grantmcdermott merged commit 5ebdaec into main Feb 18, 2025
@grantmcdermott grantmcdermott deleted the points_factors branch February 18, 2025 05:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default types should be smarter about characters

1 participant