Skip to content

Instantly share code, notes, and snippets.

@aolinto
Created April 13, 2016 14:06
Show Gist options
  • Save aolinto/150a9049e4d3d79071d9fd71fc363058 to your computer and use it in GitHub Desktop.
Save aolinto/150a9049e4d3d79071d9fd71fc363058 to your computer and use it in GitHub Desktop.
Biseau (1998) directed fishing effort
# Biseau, A. 1998. Definition os a directed fishing effort in a mixed-species trawl fishery, and its impacts on stock
# assessments. Aquat. Living Resour. 11(3):119-136
# each line refers to one trip where we have data on
# total catch per trip (Ti) and catch per species and trip (Tis)
# Antônio Olinto Ávila da Silva 13 de abril de 2016
# simulation
Ti <- rnorm(1000,4000,300)
Tis <- Ti*runif(1000,0,1)
dat.biseau <- data.frame(Ti,Tis)
rm(Ti,Tis)
# Biseau method application
# Ti is the total catch per trip and Tis is the species' catch per rip
summary(dat.biseau)
dat.biseau$C<-dat.biseau$Tis/dat.biseau$Ti
dat.biseau$j<-as.integer(dat.biseau$C*100)
agg.j<-aggregate(dat.biseau$Tis,list(j=dat.biseau$j),FUN=sum)
names(agg.j)<-c("j","TC")
dat.direc <- data.frame(0:100,rep(0,101))
names(dat.direc)<-c("j","TC")
for (i in 0:100) {
ifelse(nrow(subset(agg.j,j==i,TC))==0,
dat.direc$TC[dat.direc$j==i]<-0,
dat.direc$TC[dat.direc$j==i]<-agg.j$TC[agg.j$j==i])
}
dat.direc$P <- cumsum(dat.direc$TC)/sum(dat.direc$TC)*100
dat.direc
plot(dat.direc$P~dat.direc$j,type="l",xlab="proportion of the species in the landings of the trip (%)",ylab="accumulated landings (%)",xlim=c(0,100),ylim=c(0,100))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment