Fix NA replacement and format the Rmd