Runs into #> Error in self$palette(n): attempt to apply non-function.
Reprex:
library("ggplot2")
library("viridis")
#> Loading required package: viridisLite
# works
ggplot(mtcars) +
aes(wt, mpg, color = cyl) +
geom_point() +
scale_color_viridis()
# works
ggplot(mtcars) +
aes(wt, mpg, color = cyl) +
geom_point() +
scale_color_viridis(aesthetics = "color")
# works
ggplot(mtcars) +
aes(wt, mpg, color = factor(cyl)) +
geom_point() +
scale_color_viridis(discrete=TRUE)
# does not work
ggplot(mtcars) +
aes(wt, mpg, color = factor(cyl)) +
geom_point() +
scale_color_viridis(discrete=TRUE, aesthetics = "color")
#> Error in self$palette(n): attempt to apply non-function
# works
ggplot(mtcars) +
aes(wt, mpg, color = factor(cyl)) +
geom_point() +
scale_color_brewer()
# works
ggplot(mtcars) +
aes(wt, mpg, color = factor(cyl)) +
geom_point() +
scale_color_brewer(aesthetics = "color")
Runs into
#> Error in self$palette(n): attempt to apply non-function
.Reprex: