Skip to content

Commit 6896c7a

Browse files
committed
Some updates to tutorial steps.
1 parent 7c12cad commit 6896c7a

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

analysis/challenge.Rmd

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ file where the error occurred.
6262
The first error you will encounter is below:
6363

6464
```
65-
Quitting from lines 16-21 (spotify.Rmd)
65+
Quitting from lines 18-23 (spotify.Rmd)
6666
Error in file(file, "rt") : cannot open the connection
6767
Calls: <Anonymous> ... withVisible -> eval -> eval -> read.csv -> read.table -> file
6868
Execution halted
@@ -77,7 +77,7 @@ update the path and re-run the analysis.
7777
The next error you encounter is:
7878

7979
```
80-
Quitting from lines 27-30 (spotify.Rmd)
80+
Quitting from lines 28-31 (spotify.Rmd)
8181
Error in sample.int(length(x), size, replace, prob) :
8282
object 'numTrainingSamples' not found
8383
Calls: <Anonymous> ... withVisible -> eval -> eval -> sample -> sample.int
@@ -88,7 +88,7 @@ It looks like the variable `numTrainingSamples` isn't defined in the Rmd file.
8888
This error often occurs when a variable is interactively created in the R
8989
console, but you forget to define it in the script.
9090

91-
Based on the description above the code chunk, can you define the variable
91+
The training set should contain 3/4 of the samples. Can you define the variable
9292
`numTrainingSamples`? Hint: You can obtain the number of samples with
9393
`nrow(spotify)`.
9494

@@ -97,7 +97,7 @@ Based on the description above the code chunk, can you define the variable
9797
The next error you encounter is:
9898

9999
```
100-
Quitting from lines 36-39 (spotify.Rmd)
100+
Quitting from lines 37-40 (spotify.Rmd)
101101
Error in rpart(genre ~ ., data = spotifyTraining) :
102102
could not find function "rpart"
103103
Calls: <Anonymous> ... handle -> withCallingHandlers -> withVisible -> eval -> eval
@@ -116,15 +116,15 @@ to be loaded?
116116
The next error you encounter is:
117117

118118
```
119-
Quitting from lines 61-66 (spotify.Rmd)
120-
Error in mean(spotifyTesting[, 1] == predict_random) :
119+
Quitting from lines 62-67 (spotify.Rmd)
120+
Error in mean(spotifyTesting[, 1] == predictGuess) :
121121
object 'predict_random' not found
122122
Calls: <Anonymous> ... withCallingHandlers -> withVisible -> eval -> eval -> mean
123123
124124
Execution halted
125125
```
126126

127-
R can't find the variable named `predict_random`. Look at the surrounding code:
127+
R can't find the variable named `predictGuess`. Look at the surrounding code:
128128
what do you think the name of this variable should be?
129129

130130
Renaming variables during an analysis can lead to these subtle errors. Since

analysis/setup.Rmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ plan is sufficient for this tutorial.
3838

3939
![](assets/create-rscloud-account.jpg)
4040

41+
If you do use an email address to create your account, you will need to verify
42+
your email address by clicking on the link in the email sent by RStudio Cloud.
43+
4144
## Create your own copy of the tutorial project
4245

4346
To minimize any potential technical difficulties, I have created a project on

analysis/workflowr.Rmd

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,8 @@ once per computer (i.e. not every time you create a new workflowr project).
3838
wflow_git_config(user.name = "Your Name", user.email = "email@domain")
3939
```
4040

41-
You can run `wflow_git_config()` again with no arguments to confirm that Git is
42-
configured properly.
43-
44-
```{r git-config-confirm}
45-
wflow_git_config()
46-
```
47-
4841
Now that Git is configured, you can start your workflowr project using
49-
`wflow_start()`. It is more common to start a workflowr proejct in a brand new
42+
`wflow_start()`. It is more common to start a workflowr project in a brand new
5043
directory, but the workflowr setup can also be added to an existing analysis. To
5144
limit the tutorial to one RStudio Cloud project, you will create the workflowr
5245
project in the same directory where you've already been working on the Spotify
@@ -95,17 +88,22 @@ wflow_build()
9588

9689
Next add the Spotify analysis files to the workflowr project. You can do this
9790
via the files Pane or the running the commands below in the R console. The Rmd
98-
file goes to `analysis/` and the data file to `data/`.
91+
file goes to `analysis/` and the data file to `data/`. Also remove
92+
`spotify.html` since it will be re-built later as part of the workflowr project.
9993

10094
```{r move-files}
10195
file.rename("spotify.Rmd", "analysis/spotify.Rmd")
10296
file.rename("spotify.csv", "data/spotify.csv")
97+
file.remove("spotify.html")
10398
```
10499

105-
And since `spotify.csv` is no longer in the same directory as `spotify.Rmd`,
100+
After moving the Rmd file, RStudio will prompt you to close `spotify.Rmd`.
101+
Accept and re-open it by navigating to `analysis/` in the Files pane.
102+
103+
Since `spotify.csv` is no longer in the same directory as `spotify.Rmd`,
106104
you need to update the path passed to `read.csv()`. By default, all Rmd files
107105
in a workflowr project are executed in the root of the project, so the updated
108-
path is `data/spotify.csv`. Open `analysis/spotify.Rmd` and change the import
106+
path is `data/spotify.csv`. In `analysis/spotify.Rmd` change the import
109107
line to the line below:
110108

111109
```
@@ -191,14 +189,9 @@ username:
191189
wflow_git_remote("origin", user = "<github-username>", repo = "workflowr-spotify")
192190
```
193191

194-
Run `wflow_git_remote()` a second time, this time with no arguments, to have it
195-
list the available remote repositories. The URL will look something like
192+
The URL will look something like
196193
`https://github.com/<github-username>/workflowr-spotify.git`.
197194

198-
```{r git-remote-confirm}
199-
wflow_git_remote()
200-
```
201-
202195
Note that "origin" is an alias for referring to that long URL. The name "origin"
203196
is a convention, and could be anything you wanted. The main benefit of following
204197
the convention is that it will make it easier to follow online
@@ -220,7 +213,9 @@ updates, scroll back down to the same section to retreive the URL. It will look
220213
like `https://<github-username>.github.io/workflowr-spotify/`. Click on it to
221214
view your workflowr website. If it displays a "404 Not Found" error, manually
222215
add `index.html` to the URL in the web browser (Long-term you don't have to do
223-
this. It only applies when GitHub Pages is first launching your website).
216+
this. It only applies when GitHub Pages is first launching your website). If
217+
that trick doesn't work, you'll have to be patient and wait a few minutes for
218+
the site to be available.
224219

225220
Now you have a website that containing your reproducible results that you can
226221
share with your colleagues! And each time you make changes and push them to

0 commit comments

Comments
 (0)