diff options
author | Adam Bard <github@adambard.com> | 2013-08-11 12:05:55 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2013-08-11 12:05:55 -0700 |
commit | c6123b96d6391f493a50e77c6a07cc6128da05d0 (patch) | |
tree | 0167de5cc153f88312f0bd9b4ea645054f0f308d /r.html.markdown | |
parent | f408a2ae1de052e0433a9dbd73176ee1d91aa810 (diff) | |
parent | f0d771ddea5537e98ef47462c5c8c41b0314f856 (diff) |
Merge pull request #183 from isomorphisms/patch-4
Bender Bending Rodríguez
Diffstat (limited to 'r.html.markdown')
-rw-r--r-- | r.html.markdown | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/r.html.markdown b/r.html.markdown index e4adb5dc..03aa1dd2 100644 --- a/r.html.markdown +++ b/r.html.markdown @@ -2,6 +2,7 @@ language: R contributors: - ["e99n09", "http://github.com/e99n09"] + - ["isomorphismes", "http://twitter.com/isomorphisms"] filename: learnr.r --- @@ -296,14 +297,13 @@ if (4 > 3) { # FUNCTIONS # Defined like so: -myFunc <- function(x) { - x <- x * 4 - x <- x - 1 +jiggle <- function(x) { + x+ rnorm(x, sd=.1) #add in a bit of (controlled) noise return(x) } # Called like any other R function: -myFunc(5) # 19 +jiggle(5) # 5±ε. After set.seed(2716057), jiggle(5)==5.005043 ######################### # Fun with data: vectors, matrices, data frames, and arrays |