teunbrand / ggh4x

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

object '.int' not found #8

Closed Asajoh closed 4 years ago

Asajoh commented 4 years ago

I found your code via StackOverflow, but I don't have enough reputation to comment on your answer there. Someone else seems to have had a similar issue, and I tried loading the packages that you suggested (grid and gtable), but I'm still getting the error.

In full, it's:

Error in facet_nested(time ~ place + Hs_group) : object '.int' not found

My full code is:

nested<-ggplot(longpreds, aes(x = current, y = upper, group = Tp, col = Tp)) + 
  geom_line() +
  geom_line(aes(y=lower))+
  facet_nested(time ~place+ Hs_group)+
  geom_ribbon(data=longpreds, aes(x=current, ymin=lower, ymax=upper, fill=Tp), alpha=0.3)+
  scale_color_brewer(palette="Paired")+
  scale_fill_brewer(palette="Paired")+
  labs(x="Current (m/s)",y="Depth (m)",fill="Wave period (Tp)", color="Wave period (Tp)")+
  ylim(-15,-2)+
  scale_x_continuous(breaks = seq(0, 0.3, by = 0.1), limits=c(0,0.26))+
  theme_bw()+
  theme(
    #strip.text=element_blank(),
    #axis.title.y = element_blank(),
        legend.title = element_text(size=14),
        legend.text = element_text(size=12),
        axis.text = element_text(size = 12),
        axis.title=element_text(size=14))

It's basically panels with two lines with shading in between using geom_ribbon Any clue what might be going wrong?

Asajoh commented 4 years ago

I updated everything and installed the package and that helped. Thank you so much for this. It's awesome.

teunbrand commented 4 years ago

Alright, glad it worked out in the end!

KatLeigh11 commented 4 years ago

I'm having the same problem. I copy pasted the function code into my environment and ran it. Plus installed the 2 packages gtable and grid. still not working.

teunbrand commented 4 years ago

From a maintenance perspective I had nested facetting function depend on functions elsewhere in the package to reduce the amount of code duplication, so probably you'd have to install the package to get this working correctly.