Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Giora Simchoni
committed
Sep 6, 2017
1 parent
a372835
commit f8fb0fe
Showing
6 changed files
with
44 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
name room question solution val hint prepare cleanup | ||
r_timeRoom2_1 timeRoom2 "Create a vector of length 5 containing all twos, assign it to a variable named y" "y <- rep(2, 5)" NA Repeat two 5 times. NA "tryCatch(rm(y, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom2_2 timeRoom2 How do you list all current objects? ls() NA Unix "a <<- ""a""; b <<- ""b""; c <<- ""c""" "rm(list = ls(), envir = global.env())" | ||
r_timeRoom2_2 timeRoom2 How do you list all current objects? ls() NA Unix "a1 <<- ""a""; b1 <<- ""b""; c1 <<- ""c""" "rm(list = ls(), envir = global.env())" | ||
r_timeRoom2_3 timeRoom2 Check which elements of a vector named x are greater than -1. x > -1 NA Result should be a logical vector containing only TRUE/FALSE "x <<- c(34, -1, -10, 22, -5)" "tryCatch(rm(x, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom2_4 timeRoom2 There are missing values in a vector named z. Put zeros in there. z[is.na(z)] <- 0 NA ?is.na "z <<- c(""a"", NA, 1, TRUE, NA)" "tryCatch(rm(z, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom2_5 timeRoom2 "What is the sum of vector v, omitting missing values?" "sum(v, na.rm = TRUE)" NA na.rm v <<- runif(5); v[6] <- NA "tryCatch(rm(v, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom3_6 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_7 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_8 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_9 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_10 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_11 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA | ||
r_timeRoom3_6 timeRoom3 What is the inverse of matrix A? solve(A) NA Solve this problem quickly. "A <<- matrix(c(1:4, 9, 8, 5, 6, 7), c(3, 3))" "tryCatch(rm(A, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom3_7 timeRoom3 Get rows 21 to 40 of the airquality dataset using the head and tail functions. "tail(head(airquality, 40), 20)" NA "tail, head." NA NA | ||
r_timeRoom3_8 timeRoom3 Get all rows of the faithful dataset in which the eruptions time was over 5 minutes. Use the subset function. "subset(faithful, eruptions > 5)" NA ?subset NA NA | ||
r_timeRoom3_9 timeRoom3 Apply the mean function to each element of the list l. "lapply(l, mean)" NA ?lapply "l <<- list(1:3, 4:5, 10:14)" "tryCatch(rm(l, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom3_10 timeRoom3 Get the diagonal of matrix A diag(A) NA ??diagonal "A <<- matrix(c(1:4, 9, 8, 5, 6, 7), c(3, 3))" "tryCatch(rm(A, envir = globalenv()), warning = function(w) {invisible()})" | ||
r_timeRoom3_11 timeRoom3 "Define a named list with two elements. The value of 1 named ""a"", the value of 2 named ""b""." "list(a = 1, b = 2)" NA Uhh.. ?list? NA NA | ||
r_timeRoom3_12 timeRoom3 what is 0 + 0? 0+0 0 zero.. NA NA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
a b c | ||
0.301601015 0.182794153 0.996956735 | ||
0.699542192 0.308020014 0.207516645 | ||
0.105950656 0.888653211 0.024754042 | ||
0.427302209 0.732080114 0.469622006 | ||
0.280579872 0.734772668 0.808962717 | ||
0.114804784 0.469335069 0.996085419 | ||
0.095234452 0.838540969 0.1830606 | ||
0.652089278 0.340910176 0.099779189 | ||
0.970721244 0.650872355 0.436427513 | ||
0.361910183 0.700332518 0.007420289 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
a,1,2,3 | ||
b,2,3,4 | ||
c,3,4,5 | ||
d,4,5,6 | ||
e,5,6,7 | ||
f,6,7,8 | ||
g,7,8,9 |
Binary file not shown.