diff --git a/ReadMe.ipynb b/ReadMe.ipynb new file mode 100644 index 0000000..791d897 --- /dev/null +++ b/ReadMe.ipynb @@ -0,0 +1,76 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "898b87d6-96c4-4c9b-9713-fde12d72c176", + "metadata": {}, + "source": [ + "# SKC JupyterLab" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "bff3dc73-02d1-49de-a397-eb086ac17c33", + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:40:35) [GCC 12.3.0]\n" + ] + } + ], + "source": [ + "import sys\n", + "print(sys.version)" + ] + }, + { + "cell_type": "markdown", + "id": "96eedf95-e36d-45af-84a3-ef53016628f9", + "metadata": {}, + "source": [ + "Lessons (Day 1):\n", + "* https://datacarpentry.org/R-ecology-lesson-alternative/index.html\n", + "* https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html\n", + "* https://datacarpentry.org/R-ecology-lesson-alternative/visualizing-ggplot.html\n", + "* https://datacarpentry.org/R-ecology-lesson-alternative/how-r-thinks-about-data.html\n", + "\n", + "Lessons (Day 2):\n", + "* https://datacarpentry.org/R-ecology-lesson-alternative/working-with-data.html\n", + "* https://datacarpentry.org/R-ecology-lesson/05-r-and-databases.html" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d33cae3-32d9-431a-b806-0556792fb840", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.11.6" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/prep/Preparation.Rmd b/prep/Preparation.Rmd new file mode 100644 index 0000000..ed84821 --- /dev/null +++ b/prep/Preparation.Rmd @@ -0,0 +1,77 @@ +--- +output: html_document +editor_options: + chunk_output_type: console +--- +# Lesson Prep + +## Setup + +Update Tools with "Tools -\> Update" (do not pin) - takes a long time - don't do in class + +To have output go in console set in the config for the Rmd file set "chunk output in console" + +To view Rmd rendered (click Knit to html) in seprate windows select settings of the Rmd file and select "Preview in Window" + +Install Packages + +```{r message=FALSE, warning=FALSE} +options(repos = list(CRAN="http://cran.rstudio.com/")) +install.packages(c("tidyverse", "lubridate", "ratdat")) +``` + +## Load + +```{r} +library(tidyverse) +library(lubridate) +library(ratdat) +``` + +## Lessons Snippits + +```{r} +install.packages("ggplot2") +``` + +```{r} +library(ggplot2) +library(ratdat) +?complete_old +``` + +```{r} +# View(complete_old) +``` + +```{r} +str(complete_old) +``` + +```{r} +ggplot(data = complete_old) +``` + +```{r} +ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) + +``` + +```{r} +ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) + + geom_point() +``` +## Presentatin Style + +Top/bottom +```{r} +1+2 +3+4 +print('Hello World') + +``` + + + + + diff --git a/prep/Preparation.html b/prep/Preparation.html new file mode 100644 index 0000000..cb4f67a --- /dev/null +++ b/prep/Preparation.html @@ -0,0 +1,473 @@ + + + + +
+ + + + + + + + +Update Tools with “Tools -> Update” (do not pin) - takes a long +time - don’t do in class
+To have output go in console set in the config for the Rmd file set +“chunk output in console”
+Install Packages
+options(repos = list(CRAN="http://cran.rstudio.com/"))
+install.packages(c("tidyverse", "lubridate", "ratdat"))
+library(tidyverse)
+## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
+## ✔ dplyr 1.1.3 ✔ readr 2.1.4
+## ✔ forcats 1.0.0 ✔ stringr 1.5.0
+## ✔ ggplot2 3.5.0 ✔ tibble 3.2.1
+## ✔ lubridate 1.9.3 ✔ tidyr 1.3.0
+## ✔ purrr 1.0.2
+## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
+## ✖ dplyr::filter() masks stats::filter()
+## ✖ dplyr::lag() masks stats::lag()
+## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
+library(lubridate)
+library(ratdat)
+install.packages("ggplot2")
+## Updating HTML index of packages in '.Library'
+## Making 'packages.html' ... done
+library(ggplot2)
+library(ratdat)
+?complete_old
+# View(complete_old)
+str(complete_old)
+## tibble [16,878 × 13] (S3: tbl_df/tbl/data.frame)
+## $ record_id : int [1:16878] 1 2 3 4 5 6 7 8 9 10 ...
+## $ month : int [1:16878] 7 7 7 7 7 7 7 7 7 7 ...
+## $ day : int [1:16878] 16 16 16 16 16 16 16 16 16 16 ...
+## $ year : int [1:16878] 1977 1977 1977 1977 1977 1977 1977 1977 1977 1977 ...
+## $ plot_id : int [1:16878] 2 3 2 7 3 1 2 1 1 6 ...
+## $ species_id : chr [1:16878] "NL" "NL" "DM" "DM" ...
+## $ sex : chr [1:16878] "M" "M" "F" "M" ...
+## $ hindfoot_length: int [1:16878] 32 33 37 36 35 14 NA 37 34 20 ...
+## $ weight : int [1:16878] NA NA NA NA NA NA NA NA NA NA ...
+## $ genus : chr [1:16878] "Neotoma" "Neotoma" "Dipodomys" "Dipodomys" ...
+## $ species : chr [1:16878] "albigula" "albigula" "merriami" "merriami" ...
+## $ taxa : chr [1:16878] "Rodent" "Rodent" "Rodent" "Rodent" ...
+## $ plot_type : chr [1:16878] "Control" "Long-term Krat Exclosure" "Control" "Rodent Exclosure" ...
+ggplot(data = complete_old)
+ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length))
+ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) +
+ geom_point()
+## Warning: Removed 3081 rows containing missing values or values outside the scale range
+## (`geom_point()`).
+
+## Presentatin Style
Top/bottom
+1+2
+## [1] 3
+3+4
+## [1] 7
+print('Hello World')
+## [1] "Hello World"
+