class: center, middle, inverse, title-slide # A minimal flipbook ## With flipbookr and xaringan ### You! --- <!-- get a flipbook version of the my_cars code chunk - pauses are where parentheses are balanced --> --- count: false .panel1-my_cars-auto[ ```r *cbind(x1 = 3, x2 = c(4:1, 2:5)) ``` ] .panel2-my_cars-auto[ ``` x1 x2 [1,] 3 4 [2,] 3 3 [3,] 3 2 [4,] 3 1 [5,] 3 2 [6,] 3 3 [7,] 3 4 [8,] 3 5 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> * x ``` ] .panel2-my_cars-auto[ ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x *letters[1:8] ``` ] .panel2-my_cars-auto[ ``` [1] "a" "b" "c" "d" "e" "f" "g" "h" ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> * dimnames(x)[[1]] ``` ] .panel2-my_cars-auto[ ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] *x ``` ] .panel2-my_cars-auto[ ``` x1 x2 a 3 4 b 3 3 c 3 2 d 3 1 e 3 2 f 3 3 g 3 4 h 3 5 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% * apply(X = ., * MARGIN = 2, * FUN = mean, * trim = .2) ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) *apply(x, 2, sum) ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ``` x1 x2 24 24 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) apply(x, 2, sum) -> * col.sums ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) apply(x, 2, sum) -> col.sums *apply(x, 1, sum) ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ``` a b c d e f g h 7 6 5 4 5 6 7 8 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) apply(x, 2, sum) -> col.sums apply(x, 1, sum) -> * row.sums ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) apply(x, 2, sum) -> col.sums apply(x, 1, sum) -> row.sums *rbind(cbind(x, * Rtot = row.sums), * Ctot = c(col.sums, sum(col.sums))) ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ``` x1 x2 Rtot a 3 4 7 b 3 3 6 c 3 2 5 d 3 1 4 e 3 2 5 f 3 3 6 g 3 4 7 h 3 5 8 Ctot 24 24 48 ``` ] --- count: false .panel1-my_cars-auto[ ```r cbind(x1 = 3, x2 = c(4:1, 2:5)) -> x letters[1:8] -> dimnames(x)[[1]] x %>% apply(X = ., MARGIN = 2, FUN = mean, trim = .2) apply(x, 2, sum) -> col.sums apply(x, 1, sum) -> row.sums rbind(cbind(x, Rtot = row.sums), Ctot = c(col.sums, sum(col.sums))) ``` ] .panel2-my_cars-auto[ ``` x1 x2 3 3 ``` ``` x1 x2 Rtot a 3 4 7 b 3 3 6 c 3 2 5 d 3 1 4 e 3 2 5 f 3 3 6 g 3 4 7 h 3 5 8 Ctot 24 24 48 ``` ] <style> .panel1-my_cars-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-my_cars-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-my_cars-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style> --- count: false .panel1-lapply-auto[ ```r *list(a = 1:10, * beta = exp(-3:3), * logic = c(TRUE,FALSE,FALSE,TRUE)) ``` ] .panel2-lapply-auto[ ``` $a [1] 1 2 3 4 5 6 7 8 9 10 $beta [1] 0.04978707 0.13533528 0.36787944 1.00000000 2.71828183 7.38905610 [7] 20.08553692 $logic [1] TRUE FALSE FALSE TRUE ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> *x ``` ] .panel2-lapply-auto[ ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element *x ``` ] .panel2-lapply-auto[ ``` $a [1] 1 2 3 4 5 6 7 8 9 10 $beta [1] 0.04978707 0.13533528 0.36787944 1.00000000 2.71828183 7.38905610 [7] 20.08553692 $logic [1] TRUE FALSE FALSE TRUE ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% *lapply(., mean) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element *x ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a [1] 1 2 3 4 5 6 7 8 9 10 $beta [1] 0.04978707 0.13533528 0.36787944 1.00000000 2.71828183 7.38905610 [7] 20.08553692 $logic [1] TRUE FALSE FALSE TRUE ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% *lapply(., quantile, probs = 1:3/4) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) *x ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` $a [1] 1 2 3 4 5 6 7 8 9 10 $beta [1] 0.04978707 0.13533528 0.36787944 1.00000000 2.71828183 7.38905610 [7] 20.08553692 $logic [1] TRUE FALSE FALSE TRUE ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% *sapply(., quantile) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors *sapply(3:9, seq) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 [[3]] [1] 1 2 3 4 5 [[4]] [1] 1 2 3 4 5 6 [[5]] [1] 1 2 3 4 5 6 7 [[6]] [1] 1 2 3 4 5 6 7 8 [[7]] [1] 1 2 3 4 5 6 7 8 9 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> * i39 ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 *i39 ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 [[3]] [1] 1 2 3 4 5 [[4]] [1] 1 2 3 4 5 6 [[5]] [1] 1 2 3 4 5 6 7 [[6]] [1] 1 2 3 4 5 6 7 8 [[7]] [1] 1 2 3 4 5 6 7 8 9 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 i39 %>% *sapply(FUN = fivenum) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.0 1.0 1 1.0 1.0 1.0 1 [2,] 1.5 1.5 2 2.0 2.5 2.5 3 [3,] 2.0 2.5 3 3.5 4.0 4.5 5 [4,] 2.5 3.5 4 5.0 5.5 6.5 7 [5,] 3.0 4.0 5 6.0 7.0 8.0 9 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 i39 %>% sapply(FUN = fivenum) -> * hide ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 i39 %>% sapply(FUN = fivenum) -> hide *i39 ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [[1]] [1] 1 2 3 [[2]] [1] 1 2 3 4 [[3]] [1] 1 2 3 4 5 [[4]] [1] 1 2 3 4 5 6 [[5]] [1] 1 2 3 4 5 6 7 [[6]] [1] 1 2 3 4 5 6 7 8 [[7]] [1] 1 2 3 4 5 6 7 8 9 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 i39 %>% sapply(FUN = fivenum) -> hide i39 %>% *vapply(., FUN = fivenum, * c(Min. = 0, "1st Qu." = 0, * Median = 0, "3rd Qu." = 0, Max. = 0)) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [,1] [,2] [,3] [,4] [,5] [,6] [,7] Min. 1.0 1.0 1 1.0 1.0 1.0 1 1st Qu. 1.5 1.5 2 2.0 2.5 2.5 3 Median 2.0 2.5 3 3.5 4.0 4.5 5 3rd Qu. 2.5 3.5 4 5.0 5.5 6.5 7 Max. 3.0 4.0 5 6.0 7.0 8.0 9 ``` ] --- count: false .panel1-lapply-auto[ ```r list(a = 1:10, beta = exp(-3:3), logic = c(TRUE,FALSE,FALSE,TRUE)) -> x # compute the list mean for each list element x %>% lapply(., mean) # median and quartiles for each list element x %>% lapply(., quantile, probs = 1:3/4) x %>% sapply(., quantile) # list of vectors sapply(3:9, seq) -> i39 i39 %>% sapply(FUN = fivenum) -> hide i39 %>% vapply(., FUN = fivenum, c(Min. = 0, "1st Qu." = 0, Median = 0, "3rd Qu." = 0, Max. = 0)) ``` ] .panel2-lapply-auto[ ``` $a [1] 5.5 $beta [1] 4.535125 $logic [1] 0.5 ``` ``` $a 25% 50% 75% 3.25 5.50 7.75 $beta 25% 50% 75% 0.2516074 1.0000000 5.0536690 $logic 25% 50% 75% 0.0 0.5 1.0 ``` ``` a beta logic 0% 1.00 0.04978707 0.0 25% 3.25 0.25160736 0.0 50% 5.50 1.00000000 0.5 75% 7.75 5.05366896 1.0 100% 10.00 20.08553692 1.0 ``` ``` [,1] [,2] [,3] [,4] [,5] [,6] [,7] Min. 1.0 1.0 1 1.0 1.0 1.0 1 1st Qu. 1.5 1.5 2 2.0 2.5 2.5 3 Median 2.0 2.5 3 3.5 4.0 4.5 5 3rd Qu. 2.5 3.5 4 5.0 5.5 6.5 7 Max. 3.0 4.0 5 6.0 7.0 8.0 9 ``` ] <style> .panel1-lapply-auto { color: black; width: 38.6060606060606%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel2-lapply-auto { color: black; width: 59.3939393939394%; hight: 32%; float: left; padding-left: 1%; font-size: 80% } .panel3-lapply-auto { color: black; width: NA%; hight: 33%; float: left; padding-left: 1%; font-size: 80% } </style>