torv72 / torv-reports-v4

1 stars 0 forks source link

Script not recognizing soil types when processing report. A knitr issue? #2

Closed torv72 closed 5 months ago

torv72 commented 6 months ago

This was item #2 on the emailed list. Per your comment "Do the soil types appear when you use 2018 as well?" The answer is no. I recall last fall when I updated my RStudio version this issue happened to me. I reached out on Stackflow for an answer. The following is what I wrote and found out. Copy and paste the link in your browser as it is not active. Interestingly the water types and OM types are recognized.

"I am working in the most current R (4.3.2) and R Studio (2023.09.0 +351) versions for a Mac M2 chip setup. Anyways, I reached out on Stackflow with my problem and Yihui Xie reached out to me with an answer. He built the knitr and evaluate packages amongst many others as I discovered. He pointed out to me that about a year ago with updates to knitr and evaluate, message = FALSE is no longer valid if you want to see messages in the console. It is now message = NA. So I made the changes and everything works. Here is the blog post he directed me to that he wrote."

https://yihui.org/en/2022/12/message-false/

torv72 commented 6 months ago

When I run the script in the main branch, it works just fine and is recognizing the soil types as it should.

z3tt commented 5 months ago

Yes, I realized this change while trying to make the printing of messages work again when sourcing an Rmd. All message options should be set to NA already.

The soil types are printed again when running generate_report, there was print() instead of a message() command. Likely something I forgot to revert after testing multiple things before realizing it should be message = NA in this context.

The commit cebf198e9841f32460d1c6a54a7d960d84600047 solved the issue.