Skip to content

Commit

Permalink
begin summary stats
Browse files Browse the repository at this point in the history
  • Loading branch information
darwinanddavis authored Jul 19, 2018
1 parent 0fdcc0a commit 24ae698
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions snail_mesocosm.R
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ title("Number of cercarie for each snail length (mm)")
abline(v=mean(meso1$Diameter),lty=3,col=col)# mean diameter
outer <- meso1[which(meso1$Diameter==max(meso1$Diameter)),][,c("Diameter","Cercariae")]; outer # identify outlier
points(outer,col="red",pch=20) # plot outlier
# summary(with(meso1,lm(log(Cercariae)~Diameter))) # linear log

### Snail mass and cercariae produced (mg)
with(meso1,plot(log(Mass),Cercariae,pch=20,
Expand Down Expand Up @@ -375,6 +376,7 @@ if(length(snail_II$Tank)>0){
# Cercariae shed over 90 mins per week
### ~1000 eggs inoculated at 0,2,4,6 weeks
## Snail abundance over time (weeks)
par(mfrow=c(1,1))
xlim <- max(meso1$Week) # uses total num of weeks
ylim <- round_any(max(meso1$Cercariae),100,ceiling);ylim
with(meso1,plot(Cercariae~Week,
Expand Down Expand Up @@ -755,7 +757,7 @@ abline(h=mean(meso2$Eggs),col="pink",lty=3)

# hex and geombin for diameter vs cercariae
ggplot(meso1,aes(Diameter,Cercariae))+
geom_hex(color="white",size=0.5,alpha=0.5) +
geom_hex(color=magma(200)[length(meso1$Diameter)],size=0.5,alpha=0.5) +
# geom_bin2d(stat = "bin2d",color=col,alpha=0.5, size=0.5,linetype=1) +
scale_fill_gradientn(limits=c(0,1000), breaks=seq(0,1000, by=500), colours=magma(200)) +
# theme_ridges(grid=F,center_axis_labels = T) +
Expand Down Expand Up @@ -799,6 +801,3 @@ legend("right",legend=c("6000+", "1000-3000","<1000"),col=col,
trace=T,inset=0.3)





0 comments on commit 24ae698

Please sign in to comment.