allow R Markdown doc to be specified, and guess it if not specified