When running profvis within an R Markdown vignette (e.g., during R CMD check or vignette re-building), you may encounter errors where objects created inside the profvis() call are not accessible in the subsequent code chunks.
This typically happens because profvis captures the execution environment. If you attempt to use a result variable (like res1) outside the profvis({...}) block, the object may not be found in the global or vignette environment.
Symptoms:
ERROR: checking running R code from vignettesError: object 'res1' not foundNOTE: checking re-building of vignette outputs
# Example of code that might trigger this error in a vignette
profvis({
res1 = ft %>% select_fst(Species, Sepal.Length, Sepal.Width, Petal.Length) %>% dplyr::select(-Petal.Length)
})
# This line fails because 'res1' was not properly exported from the profvis environment
setequal(res1, res2)