Skip to content

Commit f12cde7

Browse files
committed
updatez
1 parent 94831de commit f12cde7

30 files changed

Lines changed: 12490 additions & 4198 deletions

content/code/api.html

Lines changed: 48 additions & 49 deletions
Large diffs are not rendered by default.

content/code/api.pdf

-840 KB
Binary file not shown.

content/code/basics.html

Lines changed: 634 additions & 67 deletions
Large diffs are not rendered by default.

content/code/dplyr.html

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,21 @@ <h2>The tidyverse</h2>
684684
## (as &#39;lib&#39; is unspecified)</code></pre>
685685
<pre class="r"><code>library(plyr)
686686
library(dplyr)</code></pre>
687+
<pre><code>##
688+
## Attaching package: &#39;dplyr&#39;</code></pre>
689+
<pre><code>## The following objects are masked from &#39;package:plyr&#39;:
690+
##
691+
## arrange, count, desc, failwith, id, mutate, rename, summarise,
692+
## summarize</code></pre>
693+
<pre><code>## The following objects are masked from &#39;package:terra&#39;:
694+
##
695+
## intersect, union</code></pre>
696+
<pre><code>## The following objects are masked from &#39;package:stats&#39;:
697+
##
698+
## filter, lag</code></pre>
699+
<pre><code>## The following objects are masked from &#39;package:base&#39;:
700+
##
701+
## intersect, setdiff, setequal, union</code></pre>
687702
<div id="rename" class="section level3">
688703
<h3>rename</h3>
689704
<pre class="r"><code>df &lt;- data.frame(A=runif(100), B=runif(100), D=rnorm(100,1,1))
@@ -727,12 +742,12 @@ <h3>mutate</h3>
727742
of <code>a+b</code> divided by <code>d</code>…</p>
728743
<pre class="r"><code>df2 &lt;- dplyr::mutate(df2, e=(a+b)/d)
729744
head(df2,5)</code></pre>
730-
<pre><code>## a b d e
731-
## 1 0.5759126 0.5459048 -0.4521252 -2.4812098
732-
## 2 0.8088558 0.1792595 0.4897585 2.0175562
733-
## 3 0.3131414 0.7277256 1.8675825 0.5573339
734-
## 4 0.5802145 0.9015709 0.7819910 1.8948879
735-
## 5 0.3247392 0.6711319 -0.2825055 -3.5251383</code></pre>
745+
<pre><code>## a b d e
746+
## 1 0.78126586 0.6109062 0.01766077 78.8285104
747+
## 2 0.18915914 0.6634686 1.50987626 0.5647004
748+
## 3 0.26173130 0.6793514 3.15548501 0.2982371
749+
## 4 0.06608127 0.7799481 2.55308298 0.3313756
750+
## 5 0.46853543 0.6211111 1.43936560 0.7570325</code></pre>
736751
<p>Notice that the function creates a new column and appends it to the
737752
existing data.frame, but does not “write in place”. That is, the
738753
<code>df2</code> object is not modified unless it is stored (which we do
@@ -902,9 +917,13 @@ <h3>Practice problems</h3>
902917
data for each country.</p>
903918
<pre class="r fold-hide"><code>library(plyr)
904919
library(dplyr)
905-
library(tidyr)
906-
907-
data(who)
920+
library(tidyr) </code></pre>
921+
<pre><code>##
922+
## Attaching package: &#39;tidyr&#39;</code></pre>
923+
<pre><code>## The following object is masked from &#39;package:terra&#39;:
924+
##
925+
## extract</code></pre>
926+
<pre class="r fold-hide"><code>data(who)
908927

909928
spCounts &lt;- dplyr::select(who, grep(&#39;sp&#39;, colnames(who)))
910929
who$spCounts &lt;- rowSums(spCounts, na.rm=TRUE)
@@ -933,9 +952,9 @@ <h3>Practice problems</h3>
933952
<div id="sessioninfo" class="section level2">
934953
<h2>sessionInfo</h2>
935954
<pre class="r"><code>sessionInfo()</code></pre>
936-
<pre><code>## R version 4.3.1 (2023-06-16)
937-
## Platform: x86_64-pc-linux-gnu (64-bit)
938-
## Running under: Ubuntu 22.04.3 LTS
955+
<pre><code>## R version 4.5.0 (2025-04-11)
956+
## Platform: x86_64-pc-linux-gnu
957+
## Running under: Ubuntu 22.04.5 LTS
939958
##
940959
## Matrix products: default
941960
## BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
@@ -956,18 +975,26 @@ <h2>sessionInfo</h2>
956975
## [1] stats graphics grDevices utils datasets methods base
957976
##
958977
## other attached packages:
959-
## [1] tidyr_1.3.0 dplyr_1.1.3 plyr_1.8.8
978+
## [1] tidyr_1.3.1 dplyr_1.1.4 plyr_1.8.9 DBI_1.2.3 geodata_0.5-8
979+
## [6] terra_1.8-50 sf_1.0-21 rgbif_3.7.7 jsonlite_1.8.9 httr_1.4.7
960980
##
961981
## loaded via a namespace (and not attached):
962-
## [1] vctrs_0.6.3 cli_3.6.1 knitr_1.43 rlang_1.1.1
963-
## [5] xfun_0.39 highr_0.10 purrr_1.0.1 generics_0.1.3
964-
## [9] jsonlite_1.8.7 glue_1.6.2 htmltools_0.5.5 tinytex_0.45
965-
## [13] sass_0.4.7 fansi_1.0.4 rmarkdown_2.23 jquerylib_0.1.4
966-
## [17] evaluate_0.21 tibble_3.2.1 fastmap_1.1.1 yaml_2.3.7
967-
## [21] lifecycle_1.0.3 compiler_4.3.1 Rcpp_1.0.11 pkgconfig_2.0.3
968-
## [25] digest_0.6.33 R6_2.5.1 tidyselect_1.2.0 utf8_1.2.3
969-
## [29] pillar_1.9.0 magrittr_2.0.3 bslib_0.5.0 tools_4.3.1
970-
## [33] withr_2.5.0 cachem_1.0.8</code></pre>
982+
## [1] gtable_0.3.6 xfun_0.49 bslib_0.8.0 ggplot2_3.5.1
983+
## [5] vctrs_0.6.5 tools_4.5.0 generics_0.1.4 curl_6.0.1
984+
## [9] tibble_3.2.1 proxy_0.4-27 RSQLite_2.3.7 blob_1.2.4
985+
## [13] pkgconfig_2.0.3 KernSmooth_2.23-26 data.table_1.16.2 dbplyr_2.5.0
986+
## [17] lifecycle_1.0.4 compiler_4.5.0 stringr_1.5.1 munsell_0.5.1
987+
## [21] codetools_0.2-19 htmltools_0.5.8.1 maps_3.4.1 class_7.3-23
988+
## [25] sass_0.4.9 yaml_2.3.10 lazyeval_0.2.2 pillar_1.10.2
989+
## [29] jquerylib_0.1.4 whisker_0.4.1 classInt_0.4-11 cachem_1.1.0
990+
## [33] tidyselect_1.2.1 digest_0.6.37 stringi_1.8.4 purrr_1.0.2
991+
## [37] fastmap_1.2.0 grid_4.5.0 colorspace_2.1-1 cli_3.6.5
992+
## [41] magrittr_2.0.3 utf8_1.2.5 triebeard_0.4.1 crul_1.5.0
993+
## [45] e1071_1.7-16 withr_3.0.2 scales_1.3.0 bit64_4.5.2
994+
## [49] oai_0.4.0 rmarkdown_2.29 bit_4.5.0 memoise_2.0.1
995+
## [53] evaluate_1.0.1 knitr_1.49 rlang_1.1.6 urltools_1.7.3
996+
## [57] Rcpp_1.0.14 glue_1.8.0 httpcode_0.3.0 xml2_1.3.6
997+
## [61] R6_2.6.1 units_0.8-7</code></pre>
971998
</div>
972999

9731000

content/code/git.html

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -579,13 +579,13 @@ <h2>So let’s take a tour of Github</h2>
579579
<div id="sessioninfo" class="section level2">
580580
<h2>sessionInfo</h2>
581581
<pre class="r"><code>sessionInfo()</code></pre>
582-
<pre><code>## R version 4.3.0 (2023-04-21)
583-
## Platform: x86_64-pc-linux-gnu (64-bit)
584-
## Running under: Ubuntu 22.04.2 LTS
582+
<pre><code>## R version 4.5.0 (2025-04-11)
583+
## Platform: x86_64-pc-linux-gnu
584+
## Running under: Ubuntu 22.04.5 LTS
585585
##
586586
## Matrix products: default
587-
## BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.10.0
588-
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.10.0
587+
## BLAS: /usr/lib/x86_64-linux-gnu/atlas/libblas.so.3.10.3
588+
## LAPACK: /usr/lib/x86_64-linux-gnu/atlas/liblapack.so.3.10.3; LAPACK version 3.10.0
589589
##
590590
## locale:
591591
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
@@ -602,26 +602,26 @@ <h2>sessionInfo</h2>
602602
## [1] stats graphics grDevices utils datasets methods base
603603
##
604604
## other attached packages:
605-
## [1] rmarkdown_2.22 sf_1.0-13 raster_3.6-20 sp_2.0-0 rgbif_3.7.7
605+
## [1] tidyr_1.3.1 dplyr_1.1.4 plyr_1.8.9 DBI_1.2.3 geodata_0.5-8
606+
## [6] terra_1.8-50 sf_1.0-21 rgbif_3.7.7 jsonlite_1.8.9 httr_1.4.7
606607
##
607608
## loaded via a namespace (and not attached):
608-
## [1] gtable_0.3.3 bslib_0.5.0 xfun_0.39 ggplot2_3.4.2
609-
## [5] lattice_0.21-8 tzdb_0.4.0 vctrs_0.6.3 tools_4.3.0
610-
## [9] generics_0.1.3 curl_5.0.1 parallel_4.3.0 tibble_3.2.1
611-
## [13] proxy_0.4-27 fansi_1.0.4 pkgconfig_2.0.3 KernSmooth_2.23-20
612-
## [17] data.table_1.14.8 lifecycle_1.0.3 compiler_4.3.0 stringr_1.5.0
613-
## [21] tinytex_0.45 munsell_0.5.0 terra_1.7-37 codetools_0.2-19
614-
## [25] sass_0.4.6 htmltools_0.5.5 class_7.3-21 yaml_2.3.7
615-
## [29] lazyeval_0.2.2 jquerylib_0.1.4 pillar_1.9.0 crayon_1.5.2
616-
## [33] whisker_0.4.1 classInt_0.4-9 cachem_1.0.8 tidyselect_1.2.0
617-
## [37] digest_0.6.32 stringi_1.7.12 dplyr_1.1.2 fastmap_1.1.1
618-
## [41] grid_4.3.0 colorspace_2.1-0 cli_3.6.1 magrittr_2.0.3
619-
## [45] triebeard_0.4.1 crul_1.4.0 utf8_1.2.3 e1071_1.7-13
620-
## [49] withr_2.5.0 scales_1.2.1 bit64_4.0.5 oai_0.4.0
621-
## [53] httr_1.4.6 bit_4.0.5 evaluate_0.21 knitr_1.43
622-
## [57] rlang_1.1.1 urltools_1.7.3 Rcpp_1.0.10 glue_1.6.2
623-
## [61] DBI_1.1.3 httpcode_0.3.0 xml2_1.3.4 vroom_1.6.3
624-
## [65] jsonlite_1.8.5 R6_2.5.1 plyr_1.8.8 units_0.8-2</code></pre>
609+
## [1] gtable_0.3.6 xfun_0.49 bslib_0.8.0 ggplot2_3.5.1
610+
## [5] vctrs_0.6.5 tools_4.5.0 generics_0.1.4 curl_6.0.1
611+
## [9] tibble_3.2.1 proxy_0.4-27 RSQLite_2.3.7 blob_1.2.4
612+
## [13] pkgconfig_2.0.3 KernSmooth_2.23-26 data.table_1.16.2 dbplyr_2.5.0
613+
## [17] lifecycle_1.0.4 compiler_4.5.0 stringr_1.5.1 munsell_0.5.1
614+
## [21] codetools_0.2-19 htmltools_0.5.8.1 maps_3.4.1 class_7.3-23
615+
## [25] sass_0.4.9 yaml_2.3.10 lazyeval_0.2.2 pillar_1.10.2
616+
## [29] jquerylib_0.1.4 whisker_0.4.1 classInt_0.4-11 cachem_1.1.0
617+
## [33] tidyselect_1.2.1 digest_0.6.37 stringi_1.8.4 purrr_1.0.2
618+
## [37] fastmap_1.2.0 grid_4.5.0 colorspace_2.1-1 cli_3.6.5
619+
## [41] magrittr_2.0.3 utf8_1.2.5 triebeard_0.4.1 crul_1.5.0
620+
## [45] e1071_1.7-16 withr_3.0.2 scales_1.3.0 bit64_4.5.2
621+
## [49] oai_0.4.0 rmarkdown_2.29 bit_4.5.0 memoise_2.0.1
622+
## [53] evaluate_1.0.1 knitr_1.49 rlang_1.1.6 urltools_1.7.3
623+
## [57] Rcpp_1.0.14 glue_1.8.0 httpcode_0.3.0 xml2_1.3.6
624+
## [61] R6_2.6.1 units_0.8-7</code></pre>
625625
</div>
626626
</div>
627627

content/code/iteration.html

Lines changed: 839 additions & 247 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)