mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-26 15:13:56 +00:00
Update r.html.markdown
Fixed a problem with the jiggle function - variable x wasn't being updated before being returned, and the rnorm function was being asked to return x output values, rather than one. After testing, the values given the documentation are now correct.
This commit is contained in:
parent
ee8bed8c98
commit
358f357a46
@ -298,7 +298,7 @@ if (4 > 3) {
|
|||||||
|
|
||||||
# Defined like so:
|
# Defined like so:
|
||||||
jiggle <- function(x) {
|
jiggle <- function(x) {
|
||||||
x+ rnorm(x, sd=.1) #add in a bit of (controlled) noise
|
x = x + rnorm(1, sd=.1) #add in a bit of (controlled) noise
|
||||||
return(x)
|
return(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user