-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit.Rmd
83 lines (59 loc) · 1.45 KB
/
init.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
81
82
83
---
title: "Initiate workflowr"
author: "Dave Tang"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
Load library.
```{r install}
if(!"workflowr" %in% installed.packages()){
install.packages("workflowr")
}
library(workflowr)
```
Configure Git (only need to do once per computer).
```{r git_config}
wflow_git_config(user.name = "davetang", user.email = "davetingpongtang@gmail.com")
```
Start a new workflowr project.
```{r wflow_start}
wflow_start(directory = ".", existing = TRUE)
```
Build the site.
```{r wflow_build}
wflow_build()
```
Customize your site!
1. Edit the R Markdown files in analysis/
2. Edit the theme and layout in analysis/_site.yml
3. Add new or copy existing R Markdown files to analysis/
```{r wflow_publish}
# Preview your changes
wflow_build()
# Publish the site, i.e. version the source code and HTML results
wflow_publish(c("analysis/index.Rmd", "analysis/about.Rmd", "analysis/license.Rmd"),
"New workflowr project")
```
Commit files.
```{r wflow_git_commit}
wflow_git_commit(files = c("analysis/_site.yml", "init.Rmd"))
```
Deploying website.
```{r deploy}
wflow_use_github("davetang")
```
Use R to push.
```{r wflow_git_push}
wflow_git_push()
```
Use terminal to push.
```{bash eval=FALSE}
git remote add origin git@github.com:davetang/something.git
git push -u origin master
```
Add new analysis file.
```{r wflow_open}
wflow_open("analysis/first-analysis.Rmd")
```