params not found when using knit or run all but running individual chunk works fine.

TIA, apolgies I can't post the whole rmd document (legally)

So I am using params do change to values in an rmd document. My YAML is as follows:

output: pdf_document
    value: 2019
    value: "trip1"  

Further in the code i assign these params to values:

#select the years to work on
YEARS <- params$year

TripID <- params$trip

If i run that chunk on its own it works perfectly, but if i run all or use knit it gives me the error

Error: object 'params' not found

Could there be something in the rest of the document that could be intefering? Or a peice of code I nede to add so params will work with knit etc.

Thanks for the help.

rmd file had rm(list()) to clear the GE and it was removing params. Solved now thankyou

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.