MattCowgill / ggannotate

Interactively annotate ggplots
Other
309 stars 20 forks source link

Enable ggannotate when using ggplot2 + tidiverse pipe (%>%) #21

Closed camilogarciabotero closed 4 years ago

camilogarciabotero commented 4 years ago

HI @MattCowgill,

First of all, ggannotate is such a great idea and I hope you can develop it further! So, I was trying to draw some lines in a ggplot2 plot that included some data cleaning and wrapping with the tidiverse package. Once I tried to open ggannotate it pops out the following error:

Error in all_sorted %>% select(scaffold, taxonomy) %>% ggplot(aes(fill = taxonomy, : could not find function "%>%"

If have some idea of how can I sort this out it would be great, Cheers.

camilogarciabotero commented 4 years ago

Apparently when the plot is created as a variable, and the you use ggannotate(variable) then it computes the annotation quite good!

MattCowgill commented 4 years ago

Thanks @camilogarciabotero. I’m glad you got it sorted. When it was failing for you, were you using the RStudio plugin? (The drop down menu)

camilogarciabotero commented 4 years ago

Yeap! Once I computed the ggannotate(variable) it opens the plugin!

Thank you!