On Sep 18, 2021, at 12:26 PM, Chris Evans <chrishold at psyctc.org> wrote:
This question may belong somewhere else, if so, please signpost me and accept apologies.
What is happening is that I have a large (for me, > 3k lines) Rmarkdown file with many R code blocks (no other code or
engine is used) working on some large datasets. I have some inline r like
There are `r n_distinct(tibDat$ID)` participants and `r nrow(tibDat)` rows of data.
What I am finding is that even if one knit has worked fine and I change something somewhere and knit again, the second
knit is often failing with an error like
n_distinct(tibDat$ID) : could not find function "n_distinct"
This is not happening for functions like nrow() from base R and it mostly seems to happen to functions from the tidyverse.
I think what is happening is some sort of cache corruption presumably caused by the memory demands. I am pretty sure I've
seen this before but a long time ago and dealt with it by deleting the files and cache folders created by the knit.