teunbrand / ggh4x

ggplot extension: options for tailored facets, multiple colourscales and miscellaneous
https://teunbrand.github.io/ggh4x/
Other
564 stars 33 forks source link

Error in facet_nested(. ~ class + dataset) : object '.int' not found #27

Closed dBenedek closed 3 years ago

dBenedek commented 3 years ago

Hello,

When trying to use facet_nested:

p <- ggplot(table, aes(fill = difference, x = ind, y = difference)) +
    geom_bar(position="stack", stat="identity", colour="black", width=1) +
    facet_nested(.~class+dataset) + 
    theme_minimal() +
    theme(axis.text.x = element_text(angle = 90, vjust = 0.5, hjust=1), 
          legend.position = "bottom", 
          plot.title = element_text(hjust = 0.5)) +
    labs(title=symbol, x ="Sample", y = "Isoform % expression difference") + 
    scale_fill_gradient2(low='darkorange', mid='snow3', high='darkblue', space='Lab')

I'm getting this error message: Error in facet_nested(. ~ class + dataset) : object '.int' not found

teunbrand commented 3 years ago

Hi there,

Have you tried installing the package? Seems like the error that occured in #8, which seems to surface when the package's namespace is not attached.

Best,

dBenedek commented 3 years ago

Yes, however, when I load the package there is a message:

The following object is masked _by_ ‘.GlobalEnv’:

    facet_nested

I guess this caused the problem.

teunbrand commented 3 years ago

That means that you have an object named facet_nested in your global environment, so when you use that in you console it will find the one in the global environment first due to the lexical scoping in R. If you use rm(facet_nested) and try again afterwards, I suspect it should work.

dBenedek commented 3 years ago

OK, thank you!