From 8c7505f46ce9b0e36a2daba4c3404fd2e5edf220 Mon Sep 17 00:00:00 2001 From: Timothy Middelkoop Date: Fri, 17 May 2024 14:29:16 +0000 Subject: [PATCH] Cleanup process and add Project file --- .gitignore | 3 + prep/Preparation.Rmd | 27 +-- prep/Preparation.html | 30 +-- prep/Setup.Rmd | 41 ++++ prep/Setup.html | 441 ++++++++++++++++++++++++++++++++++++++++++ skc-workshop.Rproj | 13 ++ 6 files changed, 512 insertions(+), 43 deletions(-) create mode 100644 prep/Setup.Rmd create mode 100644 prep/Setup.html create mode 100644 skc-workshop.Rproj diff --git a/.gitignore b/.gitignore index 87620ac..164c26c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ .ipynb_checkpoints/ +.Rproj.user +.Rhistory +.RData diff --git a/prep/Preparation.Rmd b/prep/Preparation.Rmd index ed84821..61a5316 100644 --- a/prep/Preparation.Rmd +++ b/prep/Preparation.Rmd @@ -1,19 +1,14 @@ --- +title: "Preparation" output: html_document editor_options: chunk_output_type: console --- -# Lesson Prep +See [Setup.Rmd](Setup.Rmd) for setting up RStudio environment.. -## Setup +# R Ecology -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 +## Install Packages ```{r message=FALSE, warning=FALSE} options(repos = list(CRAN="http://cran.rstudio.com/")) @@ -61,17 +56,3 @@ ggplot(data = complete_old, mapping = aes(x = weight, y = hindfoot_length)) 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 index cb4f67a..e798dfb 100644 --- a/prep/Preparation.html +++ b/prep/Preparation.html @@ -11,7 +11,7 @@ -Preparation.knit +Preparation + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + +
+

Setup

+

Update Tools with “Tools -> Update” (do not pin) - takes a long +time - don’t do in class.

+

Use a “R Markdown” document (output: html_document in +prolog).

+

To have the output display in the console (not inline) set in the +config for the Rmd file set “chunk output in console”.

+

To view Rmd rendered (click Knit to html) in separate windows select +settings for the Rmd file (wheel) and select “Preview in Window”

+

Prolog should look like this:

+
---
+title: "Setup"
+output: html_document
+editor_options:
+  chunk_output_type: console
+---
+

Notes:

+
    +
  • R Notebooks seem fragile and Caching output seems dangerous. Use +“Chunk Output Inline” for a more Notebook experence or use Juypter!
  • +
  • R Markdown is a bit different (lists for example) than other +markdown.
  • +
  • With Rmd files I am a fan of using the console (chunk output in +console) and use cmd-enter to run each line (opt-enter for not advancing +cursor) for development.
  • +
+
+
+

Test

+

Top/bottom

+
1+2
+
## [1] 3
+
3+4
+
## [1] 7
+
print('Hello World')
+
## [1] "Hello World"
+
+ + + + +
+ + + + + + + + + + + + + + + diff --git a/skc-workshop.Rproj b/skc-workshop.Rproj new file mode 100644 index 0000000..8e3c2eb --- /dev/null +++ b/skc-workshop.Rproj @@ -0,0 +1,13 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX