Convert from R script to R Markdown