Code Chunk and Knitted R Markdown File show different values?

Hi,
I'm completely stumped by this. When I run the code chunk in the source panel, it shows the value I want. But once I click knit and the html file pops up, it shows a completely different value. I'm new to R so I'm not sure what's happening.

Markdown runs in a completely separate environment. Try clearing your session before executing the code chunk and see if that makes any difference.

Maybe yo have other salary data, check the data in environment.

Hi, thanks for your reply.

I just exited R Studio and reopened it and it's still the same unfortunately.

That probably is the right thing to do, but just as a check is the environment window empty when you restart RStudio?

I just found out the error. When I was changing a value in a cell, I typed in the incorrect row number so it really skewed my average.

Thank you so much for your help though! :slight_smile:

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.