/
template.Rmd
81 lines (68 loc) · 1.29 KB
/
template.Rmd
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: "Template"
subtitle: "SUBTITLE"
author: "AUTHORS"
date: "`r format(Sys.Date(), '%d %b %Y')`"
output:
html_document:
df_print: paged
number_sections: no
toc: yes
toc_float: true
toc_depth: 3
code_folding: show
editor_options:
chunk_output_type: inline
---
```{r setup, include = FALSE}
# load libraries
library(tidyverse)
library(latex2exp)
library(reticulate)
# load python
use_condaenv("class", conda = "auto", required = TRUE)
# set global options for figure output
knitr::opts_chunk$set(
dev = c("png", "pdf"),
dev.args = list(pdf = list(encoding = "WinAnsi", useDingbats = FALSE)),
fig.keep = "all", fig.path = file.path("fig_output", "fig_prefix_"))
```
# $\LaTeX$ Math
This is just markdown that can include latex math.
$$
\begin{align}
\dot{x} & = \sigma(y-x) \\
\dot{y} & = \rho x - y - xz \\
\dot{z} & = -\beta z + xy
\end{align}
$$
# Python
```{python}
# python version
import sys
print(sys.version)
```
```{python}
# working directory
import os
print(os.getcwd())
```
```{python}
# script files
exec(open(os.path.join("scripts", "functions.py")).read())
print(test_add(2, 5))
```
# R
```{r}
# R version
R.version.string
```
```{r}
# working directory
getwd()
```
```{r}
# script files
source(file.path("scripts", "functions.R"))
print(test_add(2,5))
```