forked from microbiome/course_2023_oulu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.R
executable file
·30 lines (25 loc) · 1013 Bytes
/
main.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Setting up a global variable for the pkg "knitr" when attached later
# So as to save figures in a separate folder
# setHook(packageEvent("knitr", "attach"),
# function(...) knitr::opts_chunk$set(echo = FALSE, fig.path="Figures/"))
# This code below builds the Rmd file into a book that is in html format
# Restart R to clean up the environment, make sure that you've saved everything
#.rs.restartR()
# Removes all objects
rm(list = ls())
authors <- "Tuomas Borman, Leo Lahti"
library(bookdown)
# Render html files
render_book("index.Rmd", "bookdown::gitbook")
####################################
# Builds book in pdf format
# Restart R to clean up the environment, make sure that you've saved everything
#.rs.restartR()
# Removes all objects
rm(list = ls())
authors <- "Tuomas Borman, Leo Lahti"
library(bookdown)
# Render pdf files
render_book("index.Rmd", "bookdown::pdf_book")
# After you have rendered the book locally, you can observe rendered
# html files that are located in docs subfolder.