Error message when opening packrat project containing Rmd files

30 views
Skip to first unread message

Lucy

unread,
May 5, 2019, 8:11:56 AM5/5/19
to packrat-discuss

Hi,

When I open my R project that is using packrat, I get an error coming from my Rmarkdown files, specifically from particular parameters in the headers.

Quitting from lines 379-381 (4-genes_and_TCR_samples.Rmd)
Error in eval(x, envir = envir) : object 'subset_CD3s' not found
Error in eval(x, envir = envir) : object 'subset_CD3s' not found
Error in eval(x, envir = envir) : object 'subset_CD3s' not found
Error in eval(x, envir = envir) : object 'subset_CD3s' not found
Error in eval(x, envir = envir) : object 'subset_CD3s' not found
Error in eval(x, envir = envir) : object 'subset_CD3s' not found

Quitting from lines 486-488 (4-genes_and_TCR_samples_with_CD3.Rmd)
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found
Error in eval(x, envir = envir) : object 'subset_CD3s2' not found

"subset_CD3s: FALSE" is a parameter in the header of "4-genes_and_TCR_samples.Rmd", and "subset_CD3s2: FALSE" is in the header of "4-genes_and_TCR_samples_with_CD3.Rmd". I have other parameters in the same headers but these don't seem to be causing an error.

What could be the cause of this error and how can I fix it?

Thanks,
Lucy

Kevin Ushey

unread,
May 5, 2019, 6:31:39 PM5/5/19
to Lucy, packrat-discuss
This is an issue with how Packrat attempts to find R package
dependencies in R Markdown files: it attempts to render the documents
with some special evaluate hooks that would normally omit the
evaluation of any R code, but this system unfortunately misses some
cases (e.g. inline R code; 'Rscript' chunks).

One workaround is to set the R option:

options(packrat.dependency.discovery.disabled = TRUE)

so that Packrat doesn't try to crawl these dependencies. Ultimately
this is a bug on the Packrat side that needs to be fixed (we need an
alternate mechanism for finding R package dependencies in R Markdown
files)
> --
> You received this message because you are subscribed to the Google Groups "packrat-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to packrat-discu...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages