Debian Codegraph @

inst/doc/template-syntax.R

raw
1 ## ----include=FALSE------------------------------------------------------------
2 knitr::opts_chunk$set(
3 collapse = TRUE,
4 comment = "#>"
5 )
6
7 ## ----setup--------------------------------------------------------------------
8 library(jinjar)
9
10 # length-1 vector
11 title <- "My Webpage"
12
13 # vector
14 users <- c("User A", "User B", "User C")
15
16 # list
17 godzilla <- list(
18 Name = "Godzilla",
19 Born = 1952,
20 Birthplace = "Japan"
21 )
22
23 # data frame
24 navigation <- data.frame(
25 caption = c("Home", "Blog"),
26 href = c("index.html", "blog.html")
27 )
28
29 # HTML special characters
30 name <- 'Dwayne "The Rock" Johnson'
31
32 ## ----include=FALSE------------------------------------------------------------
33 params <- list(
34 title = title,
35 users = users,
36 godzilla = godzilla,
37 navigation = navigation,
38 name = name
39 )
40