fixed error in documentation and rebuilt to use in Rmd script