Hi I have a script that outputs to html format. However, the urlname is the same as the name of the script. I need to have a more web friendly url name. Is there an option to do this?
Example:
Rmd:
02-googleAnalyticsR.Rmd
HTML:
02-googleAnalyticsR.html
I can change the url name manually, but would like to know if there is an option inside Rmarkdown.
With this in the YAML header, when using the knit button in RStudio, this function will be used for rendering. You can use a fix filename like in the example or a computed filename (like with timestamp in it).
More info on this SO question which has some useful links
---
title: "Google Analytics en R, dejando de lado Excel"
author: "omar gonzáles díaz"
date: "2 de octubre de 2017"
output:
html_document:
includes:
in_header: ../header.html
before_body: ../doc_prefix.html
after_body: ../after_body.html
code_folding: show
---
Right, but what is the name of the file of which that is the YAML header? If it's 02-googleAnalytics.Rmdand you're using the Knit button, the resulting html document should, by default, be 02-googleAnalytics.html.
If you want to add 02- to the file name, and your Rmd document is googleAnalytics.Rmd (I'm not sure if this is the second in a series, or if that's by date, etc.), you can add variable/parameterized elements to that output name as in the R Markdown - variable output name StackOverflow Q&A @cderv recommended!