Skip to content

Commit

Permalink
Deploying to gh-pages from @ 4f3936c πŸš€
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Apr 28, 2024
1 parent 91dc166 commit d0c7752
Show file tree
Hide file tree
Showing 52 changed files with 1,199 additions and 1,193 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-04-22.</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-04-28.</p>
</div>

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

Expand Down Expand Up @@ -683,47 +683,47 @@ This shows why catching `interrupt` is dangerous and can result in poor user exp
sessioninfo::session_info(include_base = TRUE)
#> ─ Session info ───────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29)
#> version R version 4.4.0 (2024-04-24)
#> os Ubuntu 22.04.4 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-04-22
#> date 2024-04-28
#> pandoc 3.1.13 @ /opt/hostedtoolcache/pandoc/3.1.13/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.3 2024-04-18 [3] local
#> base * 4.4.0 2024-04-24 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> brio 1.1.4 2023-12-10 [1] RSPM
#> brio 1.1.5 2024-04-24 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.3.3 2024-04-18 [3] local
#> datasets * 4.3.3 2024-04-18 [3] local
#> compiler 4.4.0 2024-04-24 [3] local
#> datasets * 4.4.0 2024-04-24 [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
#> dplyr 1.1.4 2023-11-17 [1] RSPM
#> evaluate 0.23 2023-11-01 [1] RSPM
#> fansi 1.0.6 2023-12-08 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> 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.3.3 2024-04-18 [3] local
#> grDevices * 4.3.3 2024-04-18 [3] local
#> graphics * 4.4.0 2024-04-24 [3] local
#> grDevices * 4.4.0 2024-04-24 [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.3.3 2024-04-18 [3] local
#> methods * 4.4.0 2024-04-24 [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 @@ -733,22 +733,22 @@ 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.3.3 2024-04-18 [3] local
#> stats * 4.4.0 2024-04-24 [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.3.3 2024-04-18 [3] local
#> tools 4.4.0 2024-04-24 [3] local
#> utf8 1.2.4 2023-10-22 [1] RSPM
#> utils * 4.3.3 2024-04-18 [3] local
#> utils * 4.4.0 2024-04-24 [3] local
#> vctrs 0.6.5 2023-12-01 [1] RSPM
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.43 2024-03-25 [1] RSPM
#> xml2 1.3.6 2023-12-04 [1] RSPM
#> yaml 2.3.8 2023-12-11 [1] RSPM
#>
#> [1] /home/runner/work/_temp/Library
#> [2] /opt/R/4.3.3/lib/R/site-library
#> [3] /opt/R/4.3.3/lib/R/library
#> [2] /opt/R/4.4.0/lib/R/site-library
#> [3] /opt/R/4.4.0/lib/R/library
#>
#> ──────────────────────────────────────────────────────────
```
28 changes: 14 additions & 14 deletions Control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,57 +238,57 @@ while (i < 4) {
sessioninfo::session_info(include_base = TRUE)
#> ─ Session info ───────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29)
#> version R version 4.4.0 (2024-04-24)
#> os Ubuntu 22.04.4 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-04-22
#> date 2024-04-28
#> pandoc 3.1.13 @ /opt/hostedtoolcache/pandoc/3.1.13/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.3 2024-04-18 [3] local
#> base * 4.4.0 2024-04-24 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.3.3 2024-04-18 [3] local
#> datasets * 4.3.3 2024-04-18 [3] local
#> compiler 4.4.0 2024-04-24 [3] local
#> datasets * 4.4.0 2024-04-24 [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.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> graphics * 4.3.3 2024-04-18 [3] local
#> grDevices * 4.3.3 2024-04-18 [3] local
#> fs 1.6.4 2024-04-25 [1] RSPM
#> graphics * 4.4.0 2024-04-24 [3] local
#> grDevices * 4.4.0 2024-04-24 [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.3.3 2024-04-18 [3] local
#> methods * 4.4.0 2024-04-24 [3] local
#> R6 2.5.1 2021-08-19 [1] RSPM
#> rlang 1.1.3 2024-01-10 [1] RSPM
#> rmarkdown 2.26 2024-03-05 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.3 2024-04-18 [3] local
#> tools 4.3.3 2024-04-18 [3] local
#> utils * 4.3.3 2024-04-18 [3] local
#> stats * 4.4.0 2024-04-24 [3] local
#> tools 4.4.0 2024-04-24 [3] local
#> utils * 4.4.0 2024-04-24 [3] local
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.43 2024-03-25 [1] RSPM
#> xml2 1.3.6 2023-12-04 [1] RSPM
#> yaml 2.3.8 2023-12-11 [1] RSPM
#>
#> [1] /home/runner/work/_temp/Library
#> [2] /opt/R/4.3.3/lib/R/site-library
#> [3] /opt/R/4.3.3/lib/R/library
#> [2] /opt/R/4.4.0/lib/R/site-library
#> [3] /opt/R/4.4.0/lib/R/library
#>
#> ──────────────────────────────────────────────────────────
```
44 changes: 22 additions & 22 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: 0x55cc9ab4bd30>
#> <environment: 0x556585a04ef0>
#> 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:0x55cc9ab4bd30] <env>
#> └─loop = [1:0x55cc9ab4bd30]
#> β–ˆ [1:0x556585a04ef0] <env>
#> └─loop = [1:0x556585a04ef0]
```

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

# following should be the same
lobstr::obj_addrs(list(e1, e2$deloop))
#> [1] "0x55cc9c7c32c8" "0x55cc9c7c32c8"
#> [1] "0x556586aacd40" "0x556586aacd40"
lobstr::obj_addrs(list(e2, e1$loop))
#> [1] "0x55cc9c810a28" "0x55cc9c810a28"
#> [1] "0x55658667e7a0" "0x55658667e7a0"
```

**Q4.** Explain why `e[[1]]` and `e[c("a", "b")]` don't make sense when `e` is an environment.
Expand Down Expand Up @@ -255,7 +255,7 @@ where("filter")
#> attr(,"name")
#> [1] "package:stats"
#> attr(,"path")
#> [1] "/opt/R/4.3.3/lib/R/library/stats"
#> [1] "/opt/R/4.4.0/lib/R/library/stats"
detach("package:dplyr")
```

Expand Down Expand Up @@ -300,7 +300,7 @@ fget("mean", inherits = FALSE)
fget("mean", inherits = TRUE)
#> function (x, ...)
#> UseMethod("mean")
#> <bytecode: 0x55cc96eac440>
#> <bytecode: 0x556583088f98>
#> <environment: namespace:base>

mean <- 5
Expand Down Expand Up @@ -506,7 +506,7 @@ rlang::caller_env
#> {
#> parent.frame(n + 1)
#> }
#> <bytecode: 0x55cc9765f5c8>
#> <bytecode: 0x556584a886a8>
#> <environment: namespace:rlang>
```

Expand Down Expand Up @@ -551,38 +551,38 @@ foo()
sessioninfo::session_info(include_base = TRUE)
#> ─ Session info ───────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29)
#> version R version 4.4.0 (2024-04-24)
#> os Ubuntu 22.04.4 LTS
#> system x86_64, linux-gnu
#> ui X11
#> language (EN)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2024-04-22
#> date 2024-04-28
#> pandoc 3.1.13 @ /opt/hostedtoolcache/pandoc/3.1.13/x64/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.3 2024-04-18 [3] local
#> base * 4.4.0 2024-04-24 [3] local
#> bookdown 0.39 2024-04-15 [1] RSPM
#> bslib 0.7.0 2024-03-29 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.2 2023-12-11 [1] RSPM
#> compiler 4.3.3 2024-04-18 [3] local
#> compiler 4.4.0 2024-04-24 [3] local
#> crayon 1.5.2 2022-09-29 [1] RSPM
#> datasets * 4.3.3 2024-04-18 [3] local
#> datasets * 4.4.0 2024-04-24 [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
#> evaluate 0.23 2023-11-01 [1] RSPM
#> fansi 1.0.6 2023-12-08 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> 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.3.3 2024-04-18 [3] local
#> grDevices * 4.3.3 2024-04-18 [3] local
#> graphics * 4.4.0 2024-04-24 [3] local
#> grDevices * 4.4.0 2024-04-24 [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 @@ -592,7 +592,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.3.3 2024-04-18 [3] local
#> methods * 4.4.0 2024-04-24 [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 @@ -601,21 +601,21 @@ sessioninfo::session_info(include_base = TRUE)
#> rmarkdown 2.26 2024-03-05 [1] RSPM
#> sass 0.4.9 2024-03-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.3 2024-04-18 [3] local
#> stats * 4.4.0 2024-04-24 [3] local
#> tibble 3.2.1 2023-03-20 [1] RSPM
#> tidyselect 1.2.1 2024-03-11 [1] RSPM
#> tools 4.3.3 2024-04-18 [3] local
#> tools 4.4.0 2024-04-24 [3] local
#> utf8 1.2.4 2023-10-22 [1] RSPM
#> utils * 4.3.3 2024-04-18 [3] local
#> utils * 4.4.0 2024-04-24 [3] local
#> vctrs 0.6.5 2023-12-01 [1] RSPM
#> withr 3.0.0 2024-01-16 [1] RSPM
#> xfun 0.43 2024-03-25 [1] RSPM
#> xml2 1.3.6 2023-12-04 [1] RSPM
#> yaml 2.3.8 2023-12-11 [1] RSPM
#>
#> [1] /home/runner/work/_temp/Library
#> [2] /opt/R/4.3.3/lib/R/site-library
#> [3] /opt/R/4.3.3/lib/R/library
#> [2] /opt/R/4.4.0/lib/R/site-library
#> [3] /opt/R/4.4.0/lib/R/library
#>
#> ──────────────────────────────────────────────────────────
```
Expand Down
Loading

0 comments on commit d0c7752

Please sign in to comment.