diff --git a/Notes.Rmd b/Notes.Rmd new file mode 100644 index 0000000..42de22c --- /dev/null +++ b/Notes.Rmd @@ -0,0 +1,29 @@ +--- +title: "Show Notes" +output: html_document +editor_options: + chunk_output_type: console +--- + +# Navigate R Studio and Setup Project + + * Open RStudio + * Create a new "New Project" in `~/work` + * If you use Git (you should) use "New Project" -> "Version Control" -> "Git". + * "File" -> "New Project" -> "New Directory" -> "New Project" -> "work/skc-workshop". Projects and data must be saved in `~/work` otherwise they will be lost. Use a good name such as "skc-workshop" + * Turn off saving `.RData` in workspace + * "Tools" -> "Global Options" -> "General" (already selected) -> "Basic" (already selected) -> Under "Workspace" turn off "Restore `.RData` …" and set "Save workspace to `.RData` …" to "Never" + * Create a new "R Markdown" File + * "File" -> "New File" -> "R Markdown" -> "Create Empty Document" (bottom left button). + * Save file (cmd-s for Mac, ctrl-s for Windows/Linux) and use a good name such as "R-Ecology-Workshop" (it will add the `.Rmd` extension) + * Write, Setup, and View RMarkdown + * Write title `# RStudio` + * "Settings (gear)" -> "Preview in Viewer Pane" + * "Settings (gear)" -> "Chunk Output in Console" + * Save file + * Knit (Knit to HTML) + * Optionally set "Knit on Save" - (runs entire notebook) + +Resources: + + * https://datacarpentry.org/R-ecology-lesson-alternative/introduction-r-rstudio.html diff --git a/prep/Setup.html b/Notes.html similarity index 99% rename from prep/Setup.html rename to Notes.html index fe5986b..0de4f56 100644 --- a/prep/Setup.html +++ b/Notes.html @@ -11,7 +11,7 @@ -
See Setup.Rmd for setting up RStudio -environment..
-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.1 ✔ 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()`).
-