jbisanz/qiime2R

Newer version of dplyr no longer works with example

Opened this issue · 1 comments

I had trouble re-running an old analysis that included a code block from your example.

metadata %>%
  filter(!is.na(shannon)) %>%
  ggplot(aes(x=`days-since-experiment-start`, y=shannon, color=`body-site`)) +
  stat_summary(geom="errorbar", fun.data=mean_se, width=0) +
  stat_summary(geom="line", fun.data=mean_se) +
  stat_summary(geom="point", fun.data=mean_se) +
  xlab("Days") +
  ylab("Shannon Diversity") +
  theme_q2r() + # try other themes like theme_bw() or theme_classic()
  scale_color_viridis_d(name="Body Site") # use different color scale which is color blind friendly
  ggsave("Shannon_by_time.pdf", height=3, width=4, device="pdf") # save a PDF 3 inches by 4 inches

This returns an error now.

Error in `filter()`:
! Problem while computing `..1 = !is.na(shannon)`.
✖ Input `..1` must be of size 34 or 1, not size 31.
Traceback

Upon returning to my renv.lock file, I see I had dplyr 1.0.6 installed; however, restoring the renv environment brought dplyr to 1.0.9, which gives the error above. When rolled back to the older version of dplyr, the issue went away.

Hmm, odd. I bet this is related to having read in the artifact with the name shannon! Next time I am doing updates I will update the readme