Skip to content

Commit

Permalink
Updating code to include medians in table summarizing presence in dif…
Browse files Browse the repository at this point in the history
…ferent hosts and lakes.
  • Loading branch information
duffymeg committed May 20, 2015
1 parent ec9f2ef commit 8986418
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CodeforBPpaper.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

# Set working directory
#use line below if working on pc
setwd("C:/Users/duffymeg/Box Sync/Parasites/BroodParasite/CodeforDuffyetalBPpaper")
# setwd("C:/Users/duffymeg/Box Sync/Parasites/BroodParasite/CodeforDuffyetalBPpaper")
#use line below if working on mac
# setwd("~/Box Sync/Parasites/BroodParasite/CodeforDuffyetalBPpaper")
setwd("~/Box Sync/Parasites/BroodParasite/CodeforDuffyetalBPpaper")

# load all data
# North Fall 2013 life table
Expand Down Expand Up @@ -210,8 +210,8 @@ library(dplyr)
proppresent<-shortdata %>% group_by(Species2, Lake2) %>% summarize(prop = mean(PropBrood > 0), count = n())
enoughdates <- subset(proppresent,count>4)
enoughdates$perc <- enoughdates$prop*100
summarypresent <- enoughdates %>% group_by(Species2) %>% summarize (minprop = min(prop),maxprop = max(prop))
summarypresentbylake <- enoughdates %>% group_by(Lake2) %>% summarize (minprop = min(prop),maxprop = max(prop))
summarypresent <- enoughdates %>% group_by(Species2) %>% summarize (minprop = min(prop),maxprop = max(prop),medprop=median(prop))
summarypresentbylake <- enoughdates %>% group_by(Lake2) %>% summarize (minprop = min(prop),maxprop = max(prop),medprop=median(prop))

summarypresent
summarypresentbylake
Expand Down

0 comments on commit 8986418

Please sign in to comment.