Skip to content

Commit

Permalink
Deploying to gh-pages from @ 39bb857 πŸš€
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Oct 8, 2023
1 parent 0b7c642 commit c3606fc
Show file tree
Hide file tree
Showing 52 changed files with 775 additions and 775 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 2023-10-01.</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 2023-10-08.</p>
</div>

<div class="col-12 col-md-6 mt-3">
Expand Down
24 changes: 12 additions & 12 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: 0x55e871c1fa88>
#> <bytecode: 0x55d6c7197f10>
#> <environment: namespace:rlang>
```

Expand Down Expand Up @@ -691,39 +691,39 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2023-10-01
#> date 2023-10-08
#> pandoc 3.1.8 @ /usr/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.1 2023-08-04 [3] local
#> base * 4.3.1 2023-10-03 [3] local
#> bookdown 0.35 2023-08-09 [1] RSPM
#> brio 1.1.3 2021-11-30 [1] RSPM
#> bslib 0.5.1 2023-08-11 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.1 2023-03-23 [1] RSPM
#> compiler 4.3.1 2023-08-04 [3] local
#> datasets * 4.3.1 2023-08-04 [3] local
#> compiler 4.3.1 2023-10-03 [3] local
#> datasets * 4.3.1 2023-10-03 [3] local
#> desc 1.4.2 2022-09-08 [1] RSPM
#> digest 0.6.33 2023-07-07 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> dplyr 1.1.3 2023-09-03 [1] RSPM
#> evaluate 0.21 2023-05-05 [1] RSPM
#> evaluate 0.22 2023-09-29 [1] RSPM
#> fansi 1.0.4 2023-01-22 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> generics 0.1.3 2022-07-05 [1] RSPM
#> glue 1.6.2 2022-02-24 [1] RSPM
#> graphics * 4.3.1 2023-08-04 [3] local
#> grDevices * 4.3.1 2023-08-04 [3] local
#> graphics * 4.3.1 2023-10-03 [3] local
#> grDevices * 4.3.1 2023-10-03 [3] local
#> htmltools 0.5.6 2023-08-10 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.7 2023-06-29 [1] RSPM
#> knitr 1.44 2023-09-11 [1] RSPM
#> lifecycle 1.0.3 2022-10-07 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.3.1 2023-08-04 [3] local
#> methods * 4.3.1 2023-10-03 [3] local
#> pillar 1.9.0 2023-03-22 [1] RSPM
#> pkgconfig 2.0.3 2019-09-22 [1] RSPM
#> pkgload 1.3.3 2023-09-22 [1] RSPM
Expand All @@ -733,13 +733,13 @@ sessioninfo::session_info(include_base = TRUE)
#> rprojroot 2.0.3 2022-04-02 [1] RSPM
#> sass 0.4.7 2023-07-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.1 2023-08-04 [3] local
#> stats * 4.3.1 2023-10-03 [3] local
#> testthat * 3.1.10 2023-07-06 [1] RSPM
#> tibble 3.2.1 2023-03-20 [1] RSPM
#> tidyselect 1.2.0 2022-10-10 [1] RSPM
#> tools 4.3.1 2023-08-04 [3] local
#> tools 4.3.1 2023-10-03 [3] local
#> utf8 1.2.3 2023-01-31 [1] RSPM
#> utils * 4.3.1 2023-08-04 [3] local
#> utils * 4.3.1 2023-10-03 [3] local
#> vctrs 0.6.3 2023-06-14 [1] RSPM
#> withr 2.5.1 2023-09-26 [1] RSPM
#> xfun 0.40 2023-08-09 [1] RSPM
Expand Down
22 changes: 11 additions & 11 deletions Control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,40 +246,40 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2023-10-01
#> date 2023-10-08
#> pandoc 3.1.8 @ /usr/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.1 2023-08-04 [3] local
#> base * 4.3.1 2023-10-03 [3] local
#> bookdown 0.35 2023-08-09 [1] RSPM
#> bslib 0.5.1 2023-08-11 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.1 2023-03-23 [1] RSPM
#> compiler 4.3.1 2023-08-04 [3] local
#> datasets * 4.3.1 2023-08-04 [3] local
#> compiler 4.3.1 2023-10-03 [3] local
#> datasets * 4.3.1 2023-10-03 [3] local
#> digest 0.6.33 2023-07-07 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> evaluate 0.21 2023-05-05 [1] RSPM
#> evaluate 0.22 2023-09-29 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> graphics * 4.3.1 2023-08-04 [3] local
#> grDevices * 4.3.1 2023-08-04 [3] local
#> graphics * 4.3.1 2023-10-03 [3] local
#> grDevices * 4.3.1 2023-10-03 [3] local
#> htmltools 0.5.6 2023-08-10 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.7 2023-06-29 [1] RSPM
#> knitr 1.44 2023-09-11 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.3.1 2023-08-04 [3] local
#> methods * 4.3.1 2023-10-03 [3] local
#> R6 2.5.1 2021-08-19 [1] RSPM
#> rlang 1.1.1 2023-04-28 [1] RSPM
#> rmarkdown 2.25 2023-09-18 [1] RSPM
#> sass 0.4.7 2023-07-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.1 2023-08-04 [3] local
#> tools 4.3.1 2023-08-04 [3] local
#> utils * 4.3.1 2023-08-04 [3] local
#> stats * 4.3.1 2023-10-03 [3] local
#> tools 4.3.1 2023-10-03 [3] local
#> utils * 4.3.1 2023-10-03 [3] local
#> withr 2.5.1 2023-09-26 [1] RSPM
#> xfun 0.40 2023-08-09 [1] RSPM
#> xml2 1.3.5 2023-07-06 [1] RSPM
Expand Down
36 changes: 18 additions & 18 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: 0x55b895a49f80>
#> <environment: 0x563373c2e2e8>
#> 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:0x55b895a49f80] <env>
#> └─loop = [1:0x55b895a49f80]
#> β–ˆ [1:0x563373c2e2e8] <env>
#> └─loop = [1:0x563373c2e2e8]
```

**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] "0x55b8978efe78" "0x55b8978efe78"
#> [1] "0x563375ad33c8" "0x563375ad33c8"
lobstr::obj_addrs(list(e2, e1$loop))
#> [1] "0x55b89793f248" "0x55b89793f248"
#> [1] "0x563375b22798" "0x563375b22798"
```

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

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

Expand Down Expand Up @@ -559,30 +559,30 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2023-10-01
#> date 2023-10-08
#> pandoc 3.1.8 @ /usr/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.1 2023-08-04 [3] local
#> base * 4.3.1 2023-10-03 [3] local
#> bookdown 0.35 2023-08-09 [1] RSPM
#> bslib 0.5.1 2023-08-11 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.1 2023-03-23 [1] RSPM
#> compiler 4.3.1 2023-08-04 [3] local
#> compiler 4.3.1 2023-10-03 [3] local
#> crayon 1.5.2 2022-09-29 [1] RSPM
#> datasets * 4.3.1 2023-08-04 [3] local
#> datasets * 4.3.1 2023-10-03 [3] local
#> digest 0.6.33 2023-07-07 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> dplyr 1.1.3 2023-09-03 [1] RSPM
#> evaluate 0.21 2023-05-05 [1] RSPM
#> evaluate 0.22 2023-09-29 [1] RSPM
#> fansi 1.0.4 2023-01-22 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> generics 0.1.3 2022-07-05 [1] RSPM
#> glue 1.6.2 2022-02-24 [1] RSPM
#> graphics * 4.3.1 2023-08-04 [3] local
#> grDevices * 4.3.1 2023-08-04 [3] local
#> graphics * 4.3.1 2023-10-03 [3] local
#> grDevices * 4.3.1 2023-10-03 [3] local
#> htmltools 0.5.6 2023-08-10 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.7 2023-06-29 [1] RSPM
Expand All @@ -591,7 +591,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.1 2023-08-04 [3] local
#> methods * 4.3.1 2023-10-03 [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 @@ -600,12 +600,12 @@ sessioninfo::session_info(include_base = TRUE)
#> rmarkdown 2.25 2023-09-18 [1] RSPM
#> sass 0.4.7 2023-07-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.1 2023-08-04 [3] local
#> stats * 4.3.1 2023-10-03 [3] local
#> tibble 3.2.1 2023-03-20 [1] RSPM
#> tidyselect 1.2.0 2022-10-10 [1] RSPM
#> tools 4.3.1 2023-08-04 [3] local
#> tools 4.3.1 2023-10-03 [3] local
#> utf8 1.2.3 2023-01-31 [1] RSPM
#> utils * 4.3.1 2023-08-04 [3] local
#> utils * 4.3.1 2023-10-03 [3] local
#> vctrs 0.6.3 2023-06-14 [1] RSPM
#> withr 2.5.1 2023-09-26 [1] RSPM
#> xfun 0.40 2023-08-09 [1] RSPM
Expand Down
32 changes: 16 additions & 16 deletions Evaluation.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ withr::with_tempdir(
foo()
}
)
#> <environment: 0x563156e0a950>
#> <environment: 0x55b7ff9c0518>
#> Parent: <environment: global>
```

Expand Down Expand Up @@ -250,17 +250,17 @@ q1 <- new_quosure(expr(x), env(x = 1))
q1
#> <quosure>
#> expr: ^x
#> env: 0x563156b93b30
#> env: 0x55b7ff749840
q2 <- new_quosure(expr(x + !!q1), env(x = 10))
q2
#> <quosure>
#> expr: ^x + (^x)
#> env: 0x5631571ead58
#> env: 0x55b7ffda56b0
q3 <- new_quosure(expr(x + !!q2), env(x = 100))
q3
#> <quosure>
#> expr: ^x + (^x + (^x))
#> env: 0x5631574a9c98
#> env: 0x55b8000607c0
```

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

foo <- function(x) enenv(x)
foo()
#> <environment: 0x5631583bfba0>
#> <environment: 0x55b800f765e0>
```

---
Expand Down Expand Up @@ -674,46 +674,46 @@ sessioninfo::session_info(include_base = TRUE)
#> collate C.UTF-8
#> ctype C.UTF-8
#> tz UTC
#> date 2023-10-01
#> date 2023-10-08
#> pandoc 3.1.8 @ /usr/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────
#> package * version date (UTC) lib source
#> base * 4.3.1 2023-08-04 [3] local
#> base * 4.3.1 2023-10-03 [3] local
#> bookdown 0.35 2023-08-09 [1] RSPM
#> bslib 0.5.1 2023-08-11 [1] RSPM
#> cachem 1.0.8 2023-05-01 [1] RSPM
#> cli 3.6.1 2023-03-23 [1] RSPM
#> compiler 4.3.1 2023-08-04 [3] local
#> datasets * 4.3.1 2023-08-04 [3] local
#> compiler 4.3.1 2023-10-03 [3] local
#> datasets * 4.3.1 2023-10-03 [3] local
#> digest 0.6.33 2023-07-07 [1] RSPM
#> downlit 0.4.3 2023-06-29 [1] RSPM
#> evaluate 0.21 2023-05-05 [1] RSPM
#> evaluate 0.22 2023-09-29 [1] RSPM
#> fansi 1.0.4 2023-01-22 [1] RSPM
#> fastmap 1.1.1 2023-02-24 [1] RSPM
#> fs 1.6.3 2023-07-20 [1] RSPM
#> glue 1.6.2 2022-02-24 [1] RSPM
#> graphics * 4.3.1 2023-08-04 [3] local
#> grDevices * 4.3.1 2023-08-04 [3] local
#> graphics * 4.3.1 2023-10-03 [3] local
#> grDevices * 4.3.1 2023-10-03 [3] local
#> htmltools 0.5.6 2023-08-10 [1] RSPM
#> jquerylib 0.1.4 2021-04-26 [1] RSPM
#> jsonlite 1.8.7 2023-06-29 [1] RSPM
#> knitr 1.44 2023-09-11 [1] RSPM
#> lifecycle 1.0.3 2022-10-07 [1] RSPM
#> magrittr * 2.0.3 2022-03-30 [1] RSPM
#> memoise 2.0.1 2021-11-26 [1] RSPM
#> methods * 4.3.1 2023-08-04 [3] local
#> methods * 4.3.1 2023-10-03 [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.1 2023-04-28 [1] RSPM
#> rmarkdown 2.25 2023-09-18 [1] RSPM
#> sass 0.4.7 2023-07-15 [1] RSPM
#> sessioninfo 1.2.2 2021-12-06 [1] RSPM
#> stats * 4.3.1 2023-08-04 [3] local
#> tools 4.3.1 2023-08-04 [3] local
#> stats * 4.3.1 2023-10-03 [3] local
#> tools 4.3.1 2023-10-03 [3] local
#> utf8 1.2.3 2023-01-31 [1] RSPM
#> utils * 4.3.1 2023-08-04 [3] local
#> utils * 4.3.1 2023-10-03 [3] local
#> vctrs 0.6.3 2023-06-14 [1] RSPM
#> withr 2.5.1 2023-09-26 [1] RSPM
#> xfun 0.40 2023-08-09 [1] RSPM
Expand Down
Loading

0 comments on commit c3606fc

Please sign in to comment.