|
| 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