Rmarkdown Cannot Run Chunk but Can Run in Console

For reference, this is a duplicate of an issue posted in Github already:

@chenyinggao for next time please reference when you cross post: