Skip to content

Commit

Permalink
Add riddles to plots room
Browse files Browse the repository at this point in the history
  • Loading branch information
Giora Simchoni committed Sep 7, 2017
1 parent f983c41 commit 4646a72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions inst/extdata/CastleOfR_Doors.txt
Expand Up @@ -18,7 +18,7 @@ d_grouping_functions south grouping functions "sumSquared equals zero. Write a f
d_grouping_darkRoom3 east grouping darkRoom3 "Calculate the sum of the numbers 1 to 10 squared, without using any loop, and with the "":"" operator." sum((1:10)^2) NA Its that easy. NA NA NA NA NA NA NA NA
d_functions_models east functions models "A function f has been defined in your workspace. x is a variable which equals 2. What would be the value of x after calling ""f(3)""?" x 2 Scope. x <<- 2; f <<- function(y) x <- y "tryCatch(rm(x, f, envir = globalenv()), warning = function(w) {invisible()})" "Fit a linear regression model of y over x1 and x2 including an interaction term. Do not use the ""+"" sign." lm(y ~ x1 * x2) NA * "x1 <<- rnorm(20, 3, 4); x2 <<- runif(20, 3, 4); y <<- 2 * x1 * x2 -5 + rnorm(20); " "tryCatch(rm(x1, x2, y, envir = globalenv()), warning = function(w) {invisible()})"
d_models_darkRoom3 north models darkRoom3 lm1 is a linear model object with an intercept. Get its intercept. coef(lm1)[1] NA ?coef "x <<- rnorm(20, 3, 4); y <<- 2 * x + 1 + rnorm(20); lm1 <- lm(y ~ x)" "tryCatch(rm(x, y, lm1, envir = globalenv()), warning = function(w) {invisible()})" NA NA NA NA NA NA
d_models_plots east models plots Produce a Normal QQ plot of the vnumeric vector v. qqnorm(v) NA ?qqnorm "v <<- rexp(100, 1)" "tryCatch(rm(v, envir = globalenv()), warning = function(w) {invisible()})" what is 1 + 1? 1+1 2 two� NA NA
d_plots_timeRoom3 north plots timeRoom3 what is 0 + 0? 0+0 0 zero� NA NA NA NA NA NA NA NA
d_models_plots east models plots Produce a Normal QQ plot of the vnumeric vector v. qqnorm(v) NA ?qqnorm "v <<- rexp(100, 1)" "tryCatch(rm(v, envir = globalenv()), warning = function(w) {invisible()})" "This is the cos(x) plot of x defined in your workspace. Add the sin(x) line, in red. Use the word ""red""." "lines(x, sin(x), col = ""red"")" NA ?lines "x <<- seq(-10, 10, 0.1); plot(x, cos(x), col = ""green"", type = ""l"", ylim = c(-5, 5))" "tryCatch(rm(x, envir = globalenv()), warning = function(w) {invisible()})"
d_plots_timeRoom3 north plots timeRoom3 The ChickenWeight dataset : Plot a boxplot of the chickens weight after 20 days. boxplot(ChickWeight$weight[ChickWeight$Time == 20]) NA The answer is in the question. NA NA NA NA NA NA NA NA
d_functions_osTower up functions osTower Get the dimensions of the attitude dataset. dim(attitude) NA The answer is in the question. NA NA what is 1 + 1? 1+1 2 two� NA NA
d_plots_packagesTower up plots packagesTower what is 0 + 0? 0+0 0 zero� NA NA what is 1 + 1? 1+1 2 two� NA NA
d_plots_packagesTower up plots packagesTower "What to add before ""plot(x, y); plot(x, z)"" in order to make the two plots appear side by side?" "par(mfrow = c(1, 2)" NA ?par NA "par(mfrow = c(1,1))" what is 1 + 1? 1+1 2 two� NA NA
4 changes: 2 additions & 2 deletions inst/extdata/CastleOfR_Objects.txt
Expand Up @@ -22,8 +22,8 @@ o_functions_20 functions toothbrush on a bed power 3 "The following function def
o_functions_21 functions battery in a cupboard pwd 0 "Write a function named sayHi which receives an argument named yourName and prints ""Hi, yourName"" to the screen (use the print and paste functions). If the yourName argument is missing, the function should print ""Hi, Lady R""." "sayHi <- function(yourName = ""Lady R"") print(paste(""Hi,"", yourName))" NA "One liner, curly brackets." NA 0 NA "tryCatch(rm(sayHi, envir = globalenv()), warning = function(w) {invisible()})"
o_models_22 models lightbulb lying on the floor power 3 x and y are two numeric vectors defined in your workspace. Fit a linear regression model of y over x. lm(y ~ x) NA ?lm NA 0 "x <<- rnorm(20, 3, 4); y <<- 2 * x + 1 + rnorm(20)" "tryCatch(rm(x, y, envir = globalenv()), warning = function(w) {invisible()})"
o_models_23 models postcard on the wall map 0 What is the Pearson Correlation Coefficient between x and y? "cor(x, y)" NA ?cor NA 4 "x <<- rnorm(20, 3, 4); y <<- 2 * x + 1 + rnorm(20)" "tryCatch(rm(x, y, envir = globalenv()), warning = function(w) {invisible()})"
o_plots_24 plots magazine on a stand tip 0 what is 0 + 0? 0 + 0 0 zero� If you want to see your password situation try ?seePassword 0 NA NA
o_plots_25 plots fork in a dustbin power 3 what is 0 + 0? 0 + 0 0 zero� NA 0 NA NA
o_plots_24 plots magazine on a stand tip 0 "Plot the faithful dataset. Use the ""f"" letters as points. Add a main title ""Old Faithful geyser""." "plot(faithful, pch = ""f"", main = ""Old Faithful geyser"")" NA ?pch If you want to see your password situation try ?seePassword 0 NA NA
o_plots_25 plots fork in a dustbin power 3 "Add the line y = 3*x - 1 to this plot. Make it a dashed line (line type 2), with width 3 and color blue. Do not use the word ""blue""." "abline(-1, 3, lty = 2, lwd = 3, col = 4)" NA ?abline NA 0 "plot(x = rnorm(5, 2), y = 5 * x + rnorm(3, 0, 5))" NA
o_packagesTower_26 packagesTower handkerchief attached to the window sill power 3 what is 0 + 0? 0 + 0 0 zero� NA 0 NA NA
o_packagesTower_27 packagesTower earing on the floor pwd 0 what is 0 + 0? 0 + 0 0 zero� NA 0 NA NA
o_osTower_28 osTower watch in the corner power 3 what is 0 + 0? 0 + 0 0 zero� NA 0 NA NA
Expand Down

0 comments on commit 4646a72

Please sign in to comment.