Skip to content

Commit

Permalink
differences for PR #91
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Dec 12, 2024
1 parent cad94a8 commit 1a34da0
Show file tree
Hide file tree
Showing 5 changed files with 1,229 additions and 1 deletion.
Binary file removed .DS_Store
Binary file not shown.
55 changes: 55 additions & 0 deletions 4-minimal-reproducible-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,14 @@ counts_per_day <- krats %>%
group_by(year, plot_id, plot_type, month, day, species_id) %>%
summarize(count_per_day = n())

### ***EDIT-start *** ###

# --> Why doesn't this use "date" like we had set up earlier?
# --> Is per day even the best way to do it? This isn't even average per day, just total per day.... Doesn't seem right
# --> what about that cut-off year? What was that about and should that be accounted for here?

### **EDIT-end** ###

counts_per_day %>%
ggplot(aes(x = plot_type, y = count_per_day, fill = species_id, group = interaction(plot_type, species_id)))+
geom_boxplot(outlier.size = 0.5)+
Expand All @@ -136,7 +144,48 @@ counts_per_day %>%
y = "Individuals per day",
fill = "Species")

### ***EDIT-start *** ###

# If I were to try and attempt to plot "krats per day, per plot this is what I would do:
counts_per_day %>%
ggplot(aes(x=plot_type, y=count_per_day, fill=species_id)) +
geom_boxplot()

# what is the group=interaction() adding?

# I feel like we need to figure out what these exclosures are doing and if it's an over-time kinda thing then that needs to be accounted for. This just doesn't look right to me?

### **EDIT-end** ###

# B. For Spectabilis-specific exclosure, we expect a lower proportion of spectabilis there than in the other plots.

### ***EDIT-start *** ###
#
# Here is a plot that shows the proportions... but it doesn't use counts_per_day
krats %>%
ggplot(aes(x= species_id, fill=plot_type)) +
geom_bar(position='fill') # easy error, forget the '' around fill
# or
krats %>%
ggstatsplot::grouped_ggbarstats(x=plot_type, y=year,
palette = 'Set2',
grouping.var = species_id)
#
# But I now see you did it over time.
# First you calculated the proportion of captured DS among plots each year, which means

prop_DS <- krats %>%
group_by(year, species_id, plot_type) %>%
summarise(total_n = n()) %>%
mutate(prop = total_n/sum(total_n)) %>%
filter(species_id == 'DS')

# then you want to plot it
ggplot(prop_DS, aes(x=year, y=prop, colour=plot_type)) +
geom_line()
# DIFFERENCE: I included all the plots in calculating the proportions.
### **EDIT-end** ###

control_spectab <- krats %>%
filter(plot_type %in% c("Control", "Spectab exclosure"))

Expand All @@ -146,6 +195,12 @@ prop_spectab <- control_spectab %>%
mutate(prop = total_count/sum(total_count)) %>%
filter(species_id == "DS") # keep only spectabilis

### **EDIT-start ###

# these proportions don't look right to me... not in the way that I was thinking about them at least...

### *EDIT-end ###

prop_spectab %>%
ggplot(aes(x = year, y = prop, col = plot_type))+
geom_point()+
Expand Down
81 changes: 81 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

#------------------------------------------------------------
# Values for this lesson.
#------------------------------------------------------------

# Which carpentry is this (swc, dc, lc, or cp)?
# swc: Software Carpentry
# dc: Data Carpentry
# lc: Library Carpentry
# cp: Carpentries (to use for instructor training for instance)
# incubator: The Carpentries Incubator
carpentry: 'incubator'

# Overall title for pages.
title: 'RRRRR, I’m stuck!'

# Date the lesson was created (YYYY-MM-DD, this is empty by default)
created: 2024-05-14

# Comma-separated list of keywords for the lesson
keywords: 'R, reprex, help, The Carpentries, error, debug, reproducible example'

# Life cycle stage of the lesson
# possible values: pre-alpha, alpha, beta, stable
life_cycle: 'pre-alpha'

# License of the lesson
license: 'CC-BY 4.0'

# Link to the source repository for this lesson
source: 'https://github.com/carpentries-incubator/R-help-reprexes'

# Default branch of your lesson
branch: 'main'

# Who to contact if there are any issues
contact: '[email protected]'

# Navigation ------------------------------------------------
#
# Use the following menu items to specify the order of
# individual pages in each dropdown section. Leave blank to
# include all pages in the folder.
#
# Example -------------
#
# episodes:
# - introduction.md
# - first-steps.md
#
# learners:
# - setup.md
#
# instructors:
# - instructor-notes.md
#
# profiles:
# - one-learner.md
# - another-learner.md

# Order of episodes in your lesson
episodes:
- 1-intro-reproducible-examples.md
- 2-identify-the-problem.Rmd
- 3-minimal-reproducible-data.Rmd
- 4-minimal-reproducible-code.Rmd
- 5-asking-your-question.md

# Information for Learners
learners:

# Information for Instructors
instructors:

# Learner Profiles
profiles:

# Customisation ---------------------------------------------
#
# This space below is where custom yaml items (e.g. pinning
# sandpaper and varnish versions) should live
2 changes: 1 addition & 1 deletion md5sum.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"episodes/1-intro-reproducible-examples.md" "d35aba14cf01b6e083d983e1f4c60fb6" "site/built/1-intro-reproducible-examples.md" "2024-12-12"
"episodes/2-identify-the-problem.Rmd" "1cff6d8c0094033c70066efe4b7830e2" "site/built/2-identify-the-problem.md" "2024-12-12"
"episodes/3-minimal-reproducible-data.Rmd" "b3853a92d2af1955e860871e5e9f1f79" "site/built/3-minimal-reproducible-data.md" "2024-12-12"
"episodes/4-minimal-reproducible-code.Rmd" "0525a28e51a80c68aae1455891db4c2b" "site/built/4-minimal-reproducible-code.md" "2024-12-12"
"episodes/4-minimal-reproducible-code.Rmd" "504b4ba412ce7bdef4d09d3251d289c1" "site/built/4-minimal-reproducible-code.md" "2024-12-12"
"episodes/5-asking-your-question.md" "416be4365580e63c6f05974f34608907" "site/built/5-asking-your-question.md" "2024-12-12"
"instructors/instructor-notes.md" "984429120cb60a82d505b6110d255794" "site/built/instructor-notes.md" "2024-12-12"
"learners/reference.md" "1c7cc4e229304d9806a13f69ca1b8ba4" "site/built/reference.md" "2024-12-12"
Expand Down
Loading

0 comments on commit 1a34da0

Please sign in to comment.