I am hoping to create a markdown script that can decide intelligently whether to run quarterly versions of scripts or monthly versions. To that end, I have different scripts that correspond to whether it should be quarterly or monthly.
My question to the group here is whether it is possible to have R decide on its own if it is a quarter or month end and then, based on that, run chunks selectively (i.e. it can turn eval = TRUE into eval = FALSE).
It looks like you can make a logical variable (or two) to pass to eval. Maybe based on the date or something in your case (i.e., however you figure out if it is the end of quarter/month )?
I haven't tried it, but see the Stack Overflow answer here:
I think some of the info in this GitHub issue also looks relevant.
Interesting. So I'm giving that a shot, but it appears that it does still run the chunk even though the value comes back as false. I've screenshotted the basic details here.
Actually, I was wrong. If I knit the document, it appears to have worked. Thank you so much for the help! This is a much more elegant solution than the people who had written this same report before had come up with. Very excited!