Skip to content

Commit

Permalink
edit code
Browse files Browse the repository at this point in the history
  • Loading branch information
lindseylabrie committed Nov 13, 2023
1 parent de8a323 commit df37ae2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
Binary file modified plots/MaxDistancePlot.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 22 additions & 1 deletion silver_carp_telemetry.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ max_dist <- rkm_tracker_date %>%
mutate(distance_max = max_rkm - min_rkm)

mean(max_dist$distance_max)
median(max_dist$distance_max)

MaxDistancePlot <- ggplot(max_dist, aes(x = reorder(as.factor(transmitter_id), -distance_max), y = distance_max )) +
geom_point() +
Expand All @@ -107,7 +108,7 @@ abs_mvmt <-rkm_tracker_date %>% mutate(abs_dist=abs(distance)) %>% arrange(trans
summarise(total_movement=sum(total_movement, na.rm = T))

sum(abs_mvmt$total_movement)

mean(abs_mvmt$total_movement)


TotalMovementPlot <- ggplot(abs_mvmt, aes(x = reorder(as.factor(transmitter_id),-total_movement), y = total_movement )) +
Expand All @@ -127,6 +128,26 @@ max(abs_mvmt$total_movement)
ggsave(TotalMovementPlot,file="plots/TotalMovementPlot.jpg", dpi = 750, width = 6, height = 5,
units = "in")

## median distance moved not including zero
max_dist_nozero <-abs_mvmt %>% filter(total_movement > 1)


ggplot(max_dist_nozero, aes(x = reorder(as.factor(transmitter_id), -total_movement), y = total_movement )) +
geom_point() +
labs(x="",
y="Maximum Total Distance Traveled (rkm)",
title = "Maximum Silver Carp Movement per Individual")+
geom_hline(data=max_dist,aes(yintercept=mean(distance_max)), color="purple")+
theme_bw()+
theme(
axis.text.x = element_blank(),
axis.text.y = element_text(),
axis.ticks = element_blank())

mean(max_dist_nozero$total_movement)



# James River Flow Data

scotland_change <- read_csv("environmental_data/scotland.csv") %>%
Expand Down

0 comments on commit df37ae2

Please sign in to comment.