Perfectly run in RMarkdown but Issue when Knit to HTML

From what I can see in your screenshot, there is no bug. You simply have forgot to assign the changes to a variable, dplyrdoesn't perform in-place modifications, it returns a new data frame instead, if you want changes to persist, you have to explicitly assign them to a variable with the assign operator (<-).

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.