teunbrand / ggnomics

A small project to add ggplot2 extensions
https://teunbrand.github.io/ggnomics/
Other
80 stars 4 forks source link

Example not working: Error in FUN(X[[i]], ...): unused argument (env = env) #38

Closed tungttnguyen closed 4 years ago

tungttnguyen commented 4 years ago

Hello,

I tried the posted example but it didn't work. Can you check what went wrong?

Thanks for this pretty cool package!


library(tidyverse, warn.conflicts = FALSE)
library(ggnomics)

phi <- 2/(1 + sqrt(5))

df <- iris
df$nester <- ifelse(df$Species == "setosa",
                    "Short Leaves",
                    "Long Leaves")

g <- ggplot(df, aes(x = Sepal.Length, y = Petal.Length)) +
  geom_point(aes(sepal.width = Sepal.Width),
             ggsubset(Species == "setosa")) +
  geom_point(aes(petal.length = Petal.Length),
             ggsubset(Species == "versicolor")) +
  geom_point(aes(petal.width = Petal.Width),
             ggsubset(Species == "virginica")) +
  facet_nested(~ nester + Species, scales = "free")
#> Warning: Ignoring unknown aesthetics: sepal.width
#> Warning: Ignoring unknown aesthetics: petal.length
#> Warning: Ignoring unknown aesthetics: petal.width
g
#> Error in FUN(X[[i]], ...): unused argument (env = env)

Created on 2020-03-24 by the reprex package (v0.3.0)

tungttnguyen commented 4 years ago

btw I'm using

ggplot2 * 3.3.0.9000 2020-03-23 [1] Github (tidyverse/ggplot2@53815f8)

teunbrand commented 4 years ago

Hi there,

I know that the facet_nested is not working (see #37), this is largely because I've moved the function to another package as I'm in the process of reshaping ggnomics to be more about genomics. My recommendation is to use the ggh4x package for facet_nested instead.

Best wishes

tungttnguyen commented 4 years ago

Thanks for the info!