Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XOR feedback for Kaija - went through the analyses #91

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
Binary file modified episodes/.DS_Store
Binary file not shown.
55 changes: 55 additions & 0 deletions episodes/4-minimal-reproducible-code.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,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?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point--I don't remember when we set up date, and I should definitely go back and use that. Will keep in mind this continuity point for future.

# --> 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you expand on what you mean by "doesn't seem right"? My goal here was to calculate the total number of individuals caught per day, so that then I could use boxplots to see the general range of how many individuals tended to be caught on a given day in each plot.

# --> 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 @@ -137,7 +145,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?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right that this is not necessary. Anyway in the new episode I've simplified this part of the analysis considerably, so it becomes moot!


# 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?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Absolutely. I was trying to keep the questions reeeeeealllly simple here because we just don't have the space to dive into investigating the biological dynamics in a lot of detail. We can discuss changing the research question to a more temporal one if you think that would be more easily understandable to illustrate the problems!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just thinking we should double-check what the exclosures were doing within the time frame we are looking at, because if they originally weren't exclosures then of course they weren't working, which could be a nugget that we add later too. I just want to make sure we get the biological interpretation of the data right, if that makes sense? And to make sure there is continuity across the episodes. I don't remember what didn't look right right now, I'll look at it again in the rendered version


### **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 @@ -147,6 +196,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...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain what you mean by not right? How were you thinking about them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HA! That's hilarious, a thoroughly unhelpful comment on my part, I think I was thinking "let's discuss at our next meeting." I don't really remember right now without looking at it... Let me see if it makes sense when I look at the rendered website and if not remind me to get back to it! I think it was a question of how the proportions were being calculated compared to what I had done... I need to look at the outputs again


### *EDIT-end ###

prop_spectab %>%
ggplot(aes(x = year, y = prop, col = plot_type))+
geom_point()+
Expand Down
Binary file added scripts/.DS_Store
Binary file not shown.
Loading