Skip to content

Commit 59a4726

Browse files
committed
Start outline of creating workflowr website
1 parent 759ea05 commit 59a4726

File tree

2 files changed

+102
-0
lines changed

2 files changed

+102
-0
lines changed

analysis/index.Rmd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Before the tutorial:
1515
During the tutorial:
1616

1717
* [Reproducibility challenge](challenge.html)
18+
* [Create a workflowr project](workflowr.html)
1819

1920
After the tutorial (optional content):
2021

analysis/workflowr.Rmd

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
title: "Create a workflowr project"
3+
author: "John Blischak"
4+
date: "2020-06-17"
5+
output: workflowr::wflow_html
6+
editor_options:
7+
chunk_output_type: console
8+
---
9+
10+
```{r setup, include=FALSE}
11+
knitr::opts_chunk$set(eval = FALSE)
12+
```
13+
14+
Modified version of workflowr vignette
15+
[Getting started with workflowr][vig-getting-started]
16+
17+
[vig-getting-started]: https://jdblischak.github.io/workflowr/articles/wflow-01-getting-started.html
18+
19+
```{r package}
20+
library(workflowr)
21+
```
22+
23+
```{r git-config}
24+
# Replace the example text with your information
25+
wflow_git_config(user.name = "Your Name", user.email = "email@domain")
26+
```
27+
28+
29+
```{r start}
30+
wflow_start(".", name = "Spotify song analysis", existing = TRUE)
31+
```
32+
33+
```output
34+
wflow_start:
35+
- Files added to existing directory /cloud/project
36+
- Project name is "Spotify song analysis"
37+
- Working directory changed to /cloud/project
38+
- Git repo initiated at /cloud/project
39+
- Files were committed in version 838de5f
40+
```
41+
42+
```{r build}
43+
wflow_build()
44+
```
45+
46+
Move files
47+
48+
```{r move-files}
49+
file.rename("spotify.Rmd", "analysis/spotify.Rmd")
50+
file.rename("spotify.csv", "data/spotify.csv")
51+
```
52+
53+
Update path in `spotify.Rmd`:
54+
55+
```
56+
spotify <- read.csv("data/spotify.csv", stringsAsFactors = FALSE)
57+
```
58+
59+
```{r build-2}
60+
wflow_build()
61+
```
62+
63+
Check results - everyone should get same numbers
64+
65+
Look at the reproducibility report
66+
67+
Open `_workflowr.yml` to show the seed that is set
68+
69+
```{r status}
70+
wflow_status()
71+
```
72+
73+
Add link in `index.Rmd`:
74+
75+
```{r link}
76+
wflow_open("analysis/index.Rmd")
77+
```
78+
79+
```
80+
[Link to spotify analysis](spotify.html)
81+
```
82+
83+
```{r github}
84+
wflow_use_github("username", repository = "workflowr-spotify", create_on_github = FALSE)
85+
```
86+
87+
```{r publish}
88+
wflow_publish(c("analysis/*Rmd", "data/spotify.csv"), "Add spotify analysis")
89+
```
90+
91+
```{r status-2}
92+
wflow_status()
93+
```
94+
95+
Create [new repository on GitHub](https://github.com/new)
96+
97+
```{r git-push}
98+
wflow_git_push()
99+
```
100+
101+
Activate GitHub Pages

0 commit comments

Comments
 (0)