Skip to content

Commit 75408c0

Browse files
committed
Revert "Remove the undefined variable challenge."
This reverts commit 329ac65.
1 parent 06b2d02 commit 75408c0

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

analysis/challenge.Rmd

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,26 @@ The function `read.csv()` is unable to open the data file. What's wrong with the
5656
path to the file? Apply what you know about absolute and relative paths to
5757
update the path and re-run the analysis.
5858

59+
## Undefined variable
60+
61+
The next error you encounter is:
62+
63+
```
64+
Quitting from lines 28-31 (spotify.Rmd)
65+
Error in sample.int(length(x), size, replace, prob) :
66+
object 'numTrainingSamples' not found
67+
Calls: <Anonymous> ... withVisible -> eval -> eval -> sample -> sample.int
68+
Execution halted
69+
```
70+
71+
It looks like the variable `numTrainingSamples` isn't defined in the Rmd file.
72+
This error often occurs when a variable is interactively created in the R
73+
console, but you forget to define it in the script.
74+
75+
The training set should contain 3/4 of the samples. Can you define the variable
76+
`numTrainingSamples`? Hint: You can obtain the number of samples with
77+
`nrow(spotify)`.
78+
5979
## Missing package
6080

6181
The next error you encounter is:

0 commit comments

Comments
 (0)