I would like to share the solution I found for the above error. (it took me a while, this is my first time posting on this forum).
in yaml: use df_print: kable instead of df_print: paged
or create a new variable with the "head" statement inside the R chunks and then print with paste statement.
Below replicating the issue in the Rmarkdown document. Note df_print: paged causes head in r chunks to fail.
title: "Replicating Error"