From 8986418e5458d0cdb84a0d580bff91bb420643e2 Mon Sep 17 00:00:00 2001 From: Meghan Duffy Date: Wed, 20 May 2015 14:49:16 -0400 Subject: [PATCH] Updating code to include medians in table summarizing presence in different hosts and lakes. --- CodeforBPpaper.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeforBPpaper.R b/CodeforBPpaper.R index a1be0b0..119701f 100644 --- a/CodeforBPpaper.R +++ b/CodeforBPpaper.R @@ -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 @@ -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