show.me: View submitted Rmd and augmented HTML in RStudio

View source: R/show_me.R

show.meR Documentation

View submitted Rmd and augmented HTML in RStudio

Description

Opens up an Rmd file in source editor and displays the corresponding HTML file in the Viewer pane. This allosw for more convenient marking with source and knitted files side-by-side.

Usage

show.me(
  id,
  module = "and",
  height = "maximize",
  online = F,
  url = "https://mivalek.github.io/.../marking/knitted/",
  offline_html_path = "../knitted"
)

Arguments

id

character. Either path to .Rmd file to mark or, if working directory has been set to file containing Rmd submission, id number of the submissions to display.

module

character. Module name. Defaults to "and" (Analysing Data)

height

numeric height of RStudio viewer window or "maximize" (default).

online

logical. Should knitted file be pulled from the web? FALSE by default.

url

cahracter. URL to a webpage containing knitted HTML files. Ignored if online=FALSE. See details.

offline_html_path

cahracter. If online=FALSE, path to knitted HTML files relative to id=. Ignored if online=TRUE.

Details

String passed to url may contain "...". If it does, it will get replace by value passed to module. This allows for easier use accross different modules, provided the file structure of the hosting website is identical except for the module name.

Value

Function does not return a value. It opens an .Rmd file in the source editor and a HTML file in the Viewer.

Examples

# not setting working directory
show.me("marking/and/2019_20/1234.Rmd")
# not setting wd, offline HTML
show.me("marking/and/2019_20/1234.Rmd", offline=F, offline_thml_path = "/knitted")
# setting wd
setwd("marking/and/2019_20")
show.me("1234")

mivalek/teachR documentation built on Aug. 26, 2022, 6 a.m.