diff --git a/docs/index.html b/docs/index.html index f87364d..c3eb326 100644 --- a/docs/index.html +++ b/docs/index.html @@ -413,7 +413,7 @@

R for Small-Scale Fishery Data

+
Categories
All (5)
Basics (4)
Data Frames (1)
Operations (1)
Packages (1)
R (4)
Setup (1)
@@ -631,45 +631,6 @@

-
-
-

-
 
-

-
- - -
No matching items diff --git a/docs/listings.json b/docs/listings.json index cf311b7..a7b49bc 100644 --- a/docs/listings.json +++ b/docs/listings.json @@ -5,8 +5,7 @@ "/r_snacks/1_rbasics.html", "/r_snacks/2_rbasics.html", "/r_snacks/3_dataframes.html", - "/r_snacks/4_packages.html", - "/r_snacks/5_tidyverse_basics.html" + "/r_snacks/4_packages.html" ] } ] \ No newline at end of file diff --git a/docs/r_snacks/1_rbasics.html b/docs/r_snacks/1_rbasics.html index be64417..cfb987d 100644 --- a/docs/r_snacks/1_rbasics.html +++ b/docs/r_snacks/1_rbasics.html @@ -638,7 +638,7 @@

-eyJhdHRyIjp7ImV2YWwiOnRydWUsImF1dG9ydW4iOmZhbHNlLCJlZGl0Ijp0cnVlfSwiY29kZSI6IiMgUHJpbnQgYSB3ZWxjb21lIG1lc3NhZ2VcbnByaW50KFwiV2VsY29tZSB0byBSIVwiKVxuXG4jIEdldCB5b3VyIFIgdmVyc2lvblxuUi52ZXJzaW9uLnN0cmluZ1xuXG4jIExpc3QgeW91ciBwcm9qZWN0IGRpcmVjdG9yaWVzXG5saXN0LmRpcnMocmVjdXJzaXZlID0gRkFMU0UpIn0= +eyJjb2RlIjoiIyBQcmludCBhIHdlbGNvbWUgbWVzc2FnZVxucHJpbnQoXCJXZWxjb21lIHRvIFIhXCIpXG5cbiMgR2V0IHlvdXIgUiB2ZXJzaW9uXG5SLnZlcnNpb24uc3RyaW5nXG5cbiMgTGlzdCB5b3VyIHByb2plY3QgZGlyZWN0b3JpZXNcbmxpc3QuZGlycyhyZWN1cnNpdmUgPSBGQUxTRSkiLCJhdHRyIjp7ImF1dG9ydW4iOmZhbHNlLCJldmFsIjp0cnVlLCJlZGl0Ijp0cnVlfX0=

@@ -694,10 +694,10 @@

Next Steps πŸš€

diff --git a/docs/r_snacks/2_rbasics.html b/docs/r_snacks/2_rbasics.html index bc3c905..8d531f7 100644 --- a/docs/r_snacks/2_rbasics.html +++ b/docs/r_snacks/2_rbasics.html @@ -458,7 +458,7 @@

Basic Mathem

@@ -470,7 +470,7 @@

Basic Mathem @@ -482,7 +482,7 @@

Basic Mathem @@ -497,7 +497,7 @@

Understandin @@ -508,7 +508,7 @@

Understandin @@ -522,7 +522,7 @@

Error M @@ -559,7 +559,7 @@

The Assignment Ope @@ -571,7 +571,7 @@

The Assignment Ope @@ -585,7 +585,7 @@

Variable Naming Rule @@ -600,7 +600,7 @@

Understandi @@ -615,7 +615,7 @@

Multiple Assignments< @@ -653,7 +653,7 @@

Numeric Data (Numbers @@ -668,7 +668,7 @@

Character Data (Text)< @@ -683,7 +683,7 @@

Logical Data (TRUE/ @@ -698,7 +698,7 @@

Type Conversion

@@ -730,7 +730,7 @@

Creating Vectors

@@ -745,7 +745,7 @@

Vector Operations

@@ -760,7 +760,7 @@

Accessing Vector @@ -775,7 +775,7 @@

Vector Functions

@@ -794,7 +794,7 @@

Using Built-in Fu @@ -809,7 +809,7 @@

Function Arguments

@@ -824,7 +824,7 @@

Getting Help w @@ -1023,7 +1023,7 @@

V @@ -1056,7 +1056,7 @@

Logical Op @@ -1071,7 +1071,7 @@

Missing Values (NA)

@@ -1086,7 +1086,7 @@

Vector Sorting @@ -1102,7 +1102,7 @@

8. Understanding Ma @@ -1115,7 +1115,7 @@

Matrix Operations

@@ -1130,7 +1130,7 @@

9. Real-World Dat @@ -1168,7 +1168,7 @@

Additional Challenge< @@ -1222,10 +1222,10 @@

10. Ad
diff --git a/docs/r_snacks/3_dataframes.html b/docs/r_snacks/3_dataframes.html index c5072aa..7e0eab8 100644 --- a/docs/r_snacks/3_dataframes.html +++ b/docs/r_snacks/3_dataframes.html @@ -640,7 +640,7 @@

Practice

@@ -774,7 +774,7 @@

Pr @@ -832,7 +832,7 @@

Practice @@ -901,10 +901,10 @@

Quick Reference Guid
diff --git a/docs/r_snacks/4_packages.html b/docs/r_snacks/4_packages.html index 1fdab97..38715fd 100644 --- a/docs/r_snacks/4_packages.html +++ b/docs/r_snacks/4_packages.html @@ -647,7 +647,7 @@

Interactive

@@ -675,7 +675,7 @@

Interactive @@ -703,7 +703,7 @@

Interactive @@ -848,10 +848,10 @@

Resources for Learn
diff --git a/docs/r_snacks/5_tidyverse_basics.html b/docs/r_snacks/5_tidyverse_basics.html deleted file mode 100644 index 36e6cc0..0000000 --- a/docs/r_snacks/5_tidyverse_basics.html +++ /dev/null @@ -1,1111 +0,0 @@ - - - - - - - - - - - -5. Getting Started with R: Data Manipulation Basics – R for SSF: Data Analysis Training - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - -
- -
-
-
-

5. Getting Started with R: Data Manipulation Basics

-
-
R
-
Data Manipulation
-
tidyverse
-
-
-
- - -
- -
-
Author
-
-

Lore

-
-
- -
-
Published
-
-

September 30, 2024

-
-
- - -
- - -
- - -
- - - -
- - - - - -
-

Introduction to tidyverse

-

The tidyverse is a collection of R packages designed for data science. In this guide, we’ll explore the basics of data manipulation using dplyr, a core package of the tidyverse.

-
-

Setting Up

-

First, let’s load the tidyverse package and create a simple dataset to work with:

-
-
-
- -
- -
-
-
-
-

Basic dplyr Operations

-

Let’s explore the fundamental dplyr verbs that you’ll use frequently:

-
-

Selecting Columns

-

Use select() to choose specific columns:

-
-
-
- -
- -
-
-
-
-

Filtering Rows

-

Use filter() to subset rows based on conditions:

-
-
-
- -
- -
-
-
-
-

Creating New Columns

-

Use mutate() to add new columns:

-
-
-
- -
- -
-
-
-
-
-

Combining Operations

-

The power of dplyr comes from combining operations using the pipe operator (%>%):

-
-
-
- -
- -
-
-
-
-

Summary Statistics

-

Use summarise() (or summarize()) with group_by() for aggregate statistics:

-
-
-
- -
- -
-
- - - - -
-
- -
-
- -
-
- -
-
- -
- - - -
- - - - - - \ No newline at end of file diff --git a/docs/search.json b/docs/search.json index 40a6c10..1576d43 100644 --- a/docs/search.json +++ b/docs/search.json @@ -186,6 +186,13 @@ "3. Packages in R" ] }, + { + "objectID": "index.html", + "href": "index.html", + "title": "R for Small-Scale Fishery Data", + "section": "", + "text": "Welcome to our interactive R programming course, specifically designed for small-scale fisheries data analysis. Learn through practical tutorials that run directly in your browser - no installation needed. Our tutorials use real fisheries examples, from basic catch data calculations to stock assessments. Start with R fundamentals and progress at your own pace, practicing each concept with interactive exercises. Each tutorial builds on previous ones, helping you develop practical skills for analyzing your fisheries data. Browse the tutorials below to begin your journey in R programming for fisheries analysis.\nRemember: The best way to learn is by doing. Don’t just read the tutorials - try the code, modify it, and experiment with your own data!\n\n\n\n\n\n\n \n \n \n Order By\n Default\n \n Title\n \n \n Date - Oldest\n \n \n Date - Newest\n \n \n Author\n \n \n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n1. Getting Started with R: Installation and First Steps\n\n\n\n\n\n\nR\n\n\nSetup\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n2. Basic Operations in R: A Technical Guide\n\n\n\n\n\n\nR\n\n\nBasics\n\n\nOperations\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n3. Understanding Data Frames in R\n\n\n\n\n\n\nR\n\n\nData Frames\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n4. Understanding R Packages: Making Your Life Easier\n\n\n\n\n\n\nR\n\n\nPackages\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\nNo matching items" + }, { "objectID": "r_snacks/1_rbasics.html", "href": "r_snacks/1_rbasics.html", @@ -285,27 +292,6 @@ "1. R Installation" ] }, - { - "objectID": "index.html", - "href": "index.html", - "title": "R for Small-Scale Fishery Data", - "section": "", - "text": "Welcome to our interactive R programming course, specifically designed for small-scale fisheries data analysis. Learn through practical tutorials that run directly in your browser - no installation needed. Our tutorials use real fisheries examples, from basic catch data calculations to stock assessments. Start with R fundamentals and progress at your own pace, practicing each concept with interactive exercises. Each tutorial builds on previous ones, helping you develop practical skills for analyzing your fisheries data. Browse the tutorials below to begin your journey in R programming for fisheries analysis.\nRemember: The best way to learn is by doing. Don’t just read the tutorials - try the code, modify it, and experiment with your own data!\n\n\n\n\n\n\n \n \n \n Order By\n Default\n \n Title\n \n \n Date - Oldest\n \n \n Date - Newest\n \n \n Author\n \n \n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n1. Getting Started with R: Installation and First Steps\n\n\n\n\n\n\nR\n\n\nSetup\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n2. Basic Operations in R: A Technical Guide\n\n\n\n\n\n\nR\n\n\nBasics\n\n\nOperations\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n3. Understanding Data Frames in R\n\n\n\n\n\n\nR\n\n\nData Frames\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n4. Understanding R Packages: Making Your Life Easier\n\n\n\n\n\n\nR\n\n\nPackages\n\n\nBasics\n\n\n\n\n\n\n\n\n\nNov 6, 2024\n\n\nSSF Training Team\n\n\n\n\n\n\n\n\n\n\n\n\n5. Getting Started with R: Data Manipulation Basics\n\n\n\n\n\n\nR\n\n\nData Manipulation\n\n\ntidyverse\n\n\n\n\n\n\n\n\n\nSep 30, 2024\n\n\nLore\n\n\n\n\n\n\nNo matching items" - }, - { - "objectID": "r_snacks/5_tidyverse_basics.html", - "href": "r_snacks/5_tidyverse_basics.html", - "title": "5. Getting Started with R: Data Manipulation Basics", - "section": "", - "text": "The tidyverse is a collection of R packages designed for data science. In this guide, we’ll explore the basics of data manipulation using dplyr, a core package of the tidyverse.\n\n\nFirst, let’s load the tidyverse package and create a simple dataset to work with:\n\n\n\n\n\n\n\n\n\n\n\nLet’s explore the fundamental dplyr verbs that you’ll use frequently:\n\n\nUse select() to choose specific columns:\n\n\n\n\n\n\n\n\n\n\n\nUse filter() to subset rows based on conditions:\n\n\n\n\n\n\n\n\n\n\n\nUse mutate() to add new columns:\n\n\n\n\n\n\n\n\n\n\n\n\nThe power of dplyr comes from combining operations using the pipe operator (%>%):\n\n\n\n\n\n\n\n\n\n\n\nUse summarise() (or summarize()) with group_by() for aggregate statistics:" - }, - { - "objectID": "r_snacks/5_tidyverse_basics.html#introduction-to-tidyverse", - "href": "r_snacks/5_tidyverse_basics.html#introduction-to-tidyverse", - "title": "5. Getting Started with R: Data Manipulation Basics", - "section": "", - "text": "The tidyverse is a collection of R packages designed for data science. In this guide, we’ll explore the basics of data manipulation using dplyr, a core package of the tidyverse.\n\n\nFirst, let’s load the tidyverse package and create a simple dataset to work with:\n\n\n\n\n\n\n\n\n\n\n\nLet’s explore the fundamental dplyr verbs that you’ll use frequently:\n\n\nUse select() to choose specific columns:\n\n\n\n\n\n\n\n\n\n\n\nUse filter() to subset rows based on conditions:\n\n\n\n\n\n\n\n\n\n\n\nUse mutate() to add new columns:\n\n\n\n\n\n\n\n\n\n\n\n\nThe power of dplyr comes from combining operations using the pipe operator (%>%):\n\n\n\n\n\n\n\n\n\n\n\nUse summarise() (or summarize()) with group_by() for aggregate statistics:" - }, { "objectID": "r_snacks/3_dataframes.html", "href": "r_snacks/3_dataframes.html", diff --git a/r_snacks/5_tidyverse_basics.qmd b/r_snacks/5_tidyverse_basics.qmd deleted file mode 100644 index a8ab8bf..0000000 --- a/r_snacks/5_tidyverse_basics.qmd +++ /dev/null @@ -1,107 +0,0 @@ ---- -title: "5. Getting Started with R: Data Manipulation Basics" -author: "Lore" -date: 2024-09-30 -format: live-html -engine: knitr -categories: ["R", "Data Manipulation", "tidyverse"] -webr: - autorun: false - render-df: gt-interactive - packages: - - tidyverse ---- -{{< include ../_extensions/r-wasm/live/_knitr.qmd >}} - -## Introduction to tidyverse -The tidyverse is a collection of R packages designed for data science. In this guide, we'll explore the basics of data manipulation using dplyr, a core package of the tidyverse. - -### Setting Up -First, let's load the tidyverse package and create a simple dataset to work with: - -```{webr} -#| autorun: false -library(tidyverse) - -# Create a sample dataset -students <- data.frame( - name = c("Alice", "Bob", "Charlie", "Diana"), - age = c(20, 22, 21, 23), - score = c(85, 92, 78, 88) -) - -# View the dataset -students -``` - -### Basic dplyr Operations -Let's explore the fundamental dplyr verbs that you'll use frequently: - -#### Selecting Columns -Use `select()` to choose specific columns: - -```{webr} -#| autorun: false -students %>% - select(name, score) -``` - -#### Filtering Rows -Use `filter()` to subset rows based on conditions: - -```{webr} -#| autorun: false -# Show students with scores above 80 -students %>% - filter(score > 80) -``` - -#### Creating New Columns -Use `mutate()` to add new columns: - -```{webr} -#| autorun: false -students %>% - mutate( - grade = case_when( - score >= 90 ~ "A", - score >= 80 ~ "B", - TRUE ~ "C" - ) - ) -``` - -### Combining Operations -The power of dplyr comes from combining operations using the pipe operator (`%>%`): - -```{webr} -#| autorun: false -students %>% - # Filter for students over 21 - filter(age > 21) %>% - # Add a grade column - mutate( - grade = case_when( - score >= 90 ~ "A", - score >= 80 ~ "B", - TRUE ~ "C" - ) - ) %>% - # Select specific columns - select(name, grade, score) %>% - # Arrange by score - arrange(desc(score)) -``` - -### Summary Statistics -Use `summarise()` (or `summarize()`) with `group_by()` for aggregate statistics: - -```{webr} -#| autorun: false -students %>% - summarise( - avg_score = mean(score), - min_score = min(score), - max_score = max(score) - ) -``` \ No newline at end of file