Skip to content

Commit

Permalink
Deploying to gh-pages from @ 5286607 πŸš€
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed May 26, 2024
1 parent 03256d4 commit d7cc1db
Show file tree
Hide file tree
Showing 52 changed files with 737 additions and 737 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ <h1>Page not found<a class="anchor" aria-label="anchor" href="#page-not-found"><
<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

<div class="col-12 col-md-6 mt-3">
<p>"<strong>Advanced R Exercises</strong>" was written by <a class="text-light" href="https://sites.google.com/site/indrajeetspatilmorality/">Indrajeet Patil</a>. It was last built on 2024-05-20.</p>
<p>"<strong>Advanced R Exercises</strong>" was written by <a class="text-light" href="https://sites.google.com/site/indrajeetspatilmorality/">Indrajeet Patil</a>. It was last built on 2024-05-26.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
22 changes: 11 additions & 11 deletions Conditions.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ rlang::catch_cnd
#> return(NULL)
#> })))
#> }
#> <bytecode: 0x5612c6763c50>
#> <bytecode: 0x562082da8400>
#> <environment: namespace:rlang>
```

Expand Down Expand Up @@ -718,19 +718,19 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-05-20
#> date 2024-05-26
#> pandoc 3.2 @ /opt/hostedtoolcache/pandoc/3.2/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.4.0 2024-05-06 [3] local
#> base * 4.4.0 2024-05-25 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> brio 1.1.5 2024-04-24 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.1.0 2024-05-16 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.4.0 2024-05-06 [3] local
#> datasets * 4.4.0 2024-05-06 [3] local
#> compiler 4.4.0 2024-05-25 [3] local
#> datasets * 4.4.0 2024-05-25 [3] local
#> desc 1.4.3 2023-12-10 [1] RSPM
#> digest 0.6.35 2024-03-11 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
Expand All @@ -741,16 +741,16 @@ sessioninfo::session_info(include_base = TRUE)
#> fs 1.6.4 2024-04-25 [1] RSPM
#> generics 0.1.3 2022-07-05 [1] RSPM
#> glue 1.7.0 2024-01-09 [1] RSPM
#> graphics * 4.4.0 2024-05-06 [3] local
#> grDevices * 4.4.0 2024-05-06 [3] local
#> graphics * 4.4.0 2024-05-25 [3] local
#> grDevices * 4.4.0 2024-05-25 [3] local
#> htmltools 0.5.8.1 2024-04-04 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.8 2023-12-04 [1] RSPM
#> knitr 1.46 2024-04-06 [1] RSPM
#> lifecycle 1.0.4 2023-11-07 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.4.0 2024-05-06 [3] local
#> methods * 4.4.0 2024-05-25 [3] local
#> pillar 1.9.0 2023-03-22 [1] RSPM
#> pkgconfig 2.0.3 2019-09-22 [1] RSPM
#> pkgload 1.3.4 2024-01-16 [1] RSPM
Expand All @@ -760,13 +760,13 @@ sessioninfo::session_info(include_base = TRUE)
#> rprojroot 2.0.4 2023-11-05 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.4.0 2024-05-06 [3] local
#> stats * 4.4.0 2024-05-25 [3] local
#> testthat * 3.2.1.1 2024-04-14 [1] RSPM
#> tibble 3.2.1 2023-03-20 [1] RSPM
#> tidyselect 1.2.1 2024-03-11 [1] RSPM
#> tools 4.4.0 2024-05-06 [3] local
#> tools 4.4.0 2024-05-25 [3] local
#> utf8 1.2.4 2023-10-22 [1] RSPM
#> utils * 4.4.0 2024-05-06 [3] local
#> utils * 4.4.0 2024-05-25 [3] local
#> vctrs 0.6.5 2023-12-01 [1] RSPM
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.44 2024-05-15 [1] RSPM
Expand Down
20 changes: 10 additions & 10 deletions Control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,41 +276,41 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-05-20
#> date 2024-05-26
#> pandoc 3.2 @ /opt/hostedtoolcache/pandoc/3.2/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.4.0 2024-05-06 [3] local
#> base * 4.4.0 2024-05-25 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.1.0 2024-05-16 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.4.0 2024-05-06 [3] local
#> datasets * 4.4.0 2024-05-06 [3] local
#> compiler 4.4.0 2024-05-25 [3] local
#> datasets * 4.4.0 2024-05-25 [3] local
#> digest 0.6.35 2024-03-11 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> evaluate 0.23 2023-11-01 [1] RSPM
#> fastmap 1.2.0 2024-05-15 [1] RSPM
#> fs 1.6.4 2024-04-25 [1] RSPM
#> graphics * 4.4.0 2024-05-06 [3] local
#> grDevices * 4.4.0 2024-05-06 [3] local
#> graphics * 4.4.0 2024-05-25 [3] local
#> grDevices * 4.4.0 2024-05-25 [3] local
#> htmltools 0.5.8.1 2024-04-04 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.8 2023-12-04 [1] RSPM
#> knitr 1.46 2024-04-06 [1] RSPM
#> lifecycle 1.0.4 2023-11-07 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.4.0 2024-05-06 [3] local
#> methods * 4.4.0 2024-05-25 [3] local
#> R6 2.5.1 2021-08-19 [1] RSPM
#> rlang 1.1.3 2024-01-10 [1] RSPM
#> rmarkdown 2.27 2024-05-17 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.4.0 2024-05-06 [3] local
#> tools 4.4.0 2024-05-06 [3] local
#> utils * 4.4.0 2024-05-06 [3] local
#> stats * 4.4.0 2024-05-25 [3] local
#> tools 4.4.0 2024-05-25 [3] local
#> utils * 4.4.0 2024-05-25 [3] local
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.44 2024-05-15 [1] RSPM
#> xml2 1.3.6 2023-12-04 [1] RSPM
Expand Down
34 changes: 17 additions & 17 deletions Environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ library(rlang)
e <- env()
e$loop <- e
env_print(e)
#> <environment: 0x555f9c123e10>
#> <environment: 0x55664902ae10>
#> Parent: <environment: global>
#> Bindings:
#> β€’ loop: <env>
Expand All @@ -51,8 +51,8 @@ The binding `loop` should have the same memory address as the environment `e`:

``` r
lobstr::ref(e$loop)
#> β–ˆ [1:0x555f9c123e10] <env>
#> └─loop = [1:0x555f9c123e10]
#> β–ˆ [1:0x55664902ae10] <env>
#> └─loop = [1:0x55664902ae10]
```

**Q3.** Create a pair of environments as illustrated by this picture.
Expand All @@ -71,12 +71,12 @@ e2$deloop <- e1

# following should be the same
lobstr::obj_addrs(list(e1, e2$deloop))
#> [1] "0x555f9cb91248" "0x555f9cb91248"
#> [1] "0x556649aa1de8" "0x556649aa1de8"
```

``` r
lobstr::obj_addrs(list(e2, e1$loop))
#> [1] "0x555f9cffedd8" "0x555f9cffedd8"
#> [1] "0x556649f0f978" "0x556649f0f978"
```

**Q4.** Explain why `e[[1]]` and `e[c("a", "b")]` don't make sense when `e` is an environment.
Expand Down Expand Up @@ -339,7 +339,7 @@ fget("mean", inherits = FALSE)
fget("mean", inherits = TRUE)
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x555f993ae8f8>
#> <bytecode: 0x5566462b58f8>
#> <environment: namespace:base>
```

Expand Down Expand Up @@ -569,7 +569,7 @@ rlang::caller_env
#> {
#> parent.frame(n + 1)
#> }
#> <bytecode: 0x555f9ade0848>
#> <bytecode: 0x556647ce7848>
#> <environment: namespace:rlang>
```

Expand Down Expand Up @@ -625,19 +625,19 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-05-20
#> date 2024-05-26
#> pandoc 3.2 @ /opt/hostedtoolcache/pandoc/3.2/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.4.0 2024-05-06 [3] local
#> base * 4.4.0 2024-05-25 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.1.0 2024-05-16 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.4.0 2024-05-06 [3] local
#> compiler 4.4.0 2024-05-25 [3] local
#> crayon 1.5.2 2022-09-29 [1] RSPM
#> datasets * 4.4.0 2024-05-06 [3] local
#> datasets * 4.4.0 2024-05-25 [3] local
#> digest 0.6.35 2024-03-11 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> dplyr 1.1.4 2023-11-17 [1] RSPM
Expand All @@ -647,8 +647,8 @@ sessioninfo::session_info(include_base = TRUE)
#> fs 1.6.4 2024-04-25 [1] RSPM
#> generics 0.1.3 2022-07-05 [1] RSPM
#> glue 1.7.0 2024-01-09 [1] RSPM
#> graphics * 4.4.0 2024-05-06 [3] local
#> grDevices * 4.4.0 2024-05-06 [3] local
#> graphics * 4.4.0 2024-05-25 [3] local
#> grDevices * 4.4.0 2024-05-25 [3] local
#> highr 0.10 2022-12-22 [1] RSPM
#> htmltools 0.5.8.1 2024-04-04 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
Expand All @@ -658,7 +658,7 @@ sessioninfo::session_info(include_base = TRUE)
#> lobstr 1.1.2 2022-06-22 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.4.0 2024-05-06 [3] local
#> methods * 4.4.0 2024-05-25 [3] local
#> pillar 1.9.0 2023-03-22 [1] RSPM
#> pkgconfig 2.0.3 2019-09-22 [1] RSPM
#> png 0.1-8 2022-11-29 [1] RSPM
Expand All @@ -667,12 +667,12 @@ sessioninfo::session_info(include_base = TRUE)
#> rmarkdown 2.27 2024-05-17 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.4.0 2024-05-06 [3] local
#> stats * 4.4.0 2024-05-25 [3] local
#> tibble 3.2.1 2023-03-20 [1] RSPM
#> tidyselect 1.2.1 2024-03-11 [1] RSPM
#> tools 4.4.0 2024-05-06 [3] local
#> tools 4.4.0 2024-05-25 [3] local
#> utf8 1.2.4 2023-10-22 [1] RSPM
#> utils * 4.4.0 2024-05-06 [3] local
#> utils * 4.4.0 2024-05-25 [3] local
#> vctrs 0.6.5 2023-12-01 [1] RSPM
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.44 2024-05-15 [1] RSPM
Expand Down
30 changes: 15 additions & 15 deletions Evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ withr::with_tempdir(
foo()
}
)
#> <environment: 0x563a63757488>
#> <environment: 0x559014f3b488>
#> Parent: <environment: global>
```

Expand Down Expand Up @@ -268,23 +268,23 @@ q1 <- new_quosure(expr(x), env(x = 1))
q1
#> <quosure>
#> expr: ^x
#> env: 0x563a641b9a90
#> env: 0x55901599da90
```

``` r
q2 <- new_quosure(expr(x + !!q1), env(x = 10))
q2
#> <quosure>
#> expr: ^x + (^x)
#> env: 0x563a648fac40
#> env: 0x5590160deb50
```

``` r
q3 <- new_quosure(expr(x + !!q2), env(x = 100))
q3
#> <quosure>
#> expr: ^x + (^x + (^x))
#> env: 0x563a655c0148
#> env: 0x559016da2228
```

**A1.** Correctly predicted πŸ˜‰
Expand Down Expand Up @@ -331,7 +331,7 @@ enenv(x)

foo <- function(x) enenv(x)
foo()
#> <environment: 0x563a66108308>
#> <environment: 0x5590178ec1b8>
```

---
Expand Down Expand Up @@ -722,46 +722,46 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-05-20
#> date 2024-05-26
#> pandoc 3.2 @ /opt/hostedtoolcache/pandoc/3.2/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.4.0 2024-05-06 [3] local
#> base * 4.4.0 2024-05-25 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.1.0 2024-05-16 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.4.0 2024-05-06 [3] local
#> datasets * 4.4.0 2024-05-06 [3] local
#> compiler 4.4.0 2024-05-25 [3] local
#> datasets * 4.4.0 2024-05-25 [3] local
#> digest 0.6.35 2024-03-11 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> evaluate 0.23 2023-11-01 [1] RSPM
#> fansi 1.0.6 2023-12-08 [1] RSPM
#> fastmap 1.2.0 2024-05-15 [1] RSPM
#> fs 1.6.4 2024-04-25 [1] RSPM
#> glue 1.7.0 2024-01-09 [1] RSPM
#> graphics * 4.4.0 2024-05-06 [3] local
#> grDevices * 4.4.0 2024-05-06 [3] local
#> graphics * 4.4.0 2024-05-25 [3] local
#> grDevices * 4.4.0 2024-05-25 [3] local
#> htmltools 0.5.8.1 2024-04-04 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.8 2023-12-04 [1] RSPM
#> knitr 1.46 2024-04-06 [1] RSPM
#> lifecycle 1.0.4 2023-11-07 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.4.0 2024-05-06 [3] local
#> methods * 4.4.0 2024-05-25 [3] local
#> pillar 1.9.0 2023-03-22 [1] RSPM
#> purrr 1.0.2 2023-08-10 [1] RSPM
#> R6 2.5.1 2021-08-19 [1] RSPM
#> rlang * 1.1.3 2024-01-10 [1] RSPM
#> rmarkdown 2.27 2024-05-17 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.4.0 2024-05-06 [3] local
#> tools 4.4.0 2024-05-06 [3] local
#> stats * 4.4.0 2024-05-25 [3] local
#> tools 4.4.0 2024-05-25 [3] local
#> utf8 1.2.4 2023-10-22 [1] RSPM
#> utils * 4.4.0 2024-05-06 [3] local
#> utils * 4.4.0 2024-05-25 [3] local
#> vctrs 0.6.5 2023-12-01 [1] RSPM
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.44 2024-05-15 [1] RSPM
Expand Down
Loading

0 comments on commit d7cc1db

Please sign in to comment.