library(knitr) library(rmarkdown) options(max.print="90") opts_chunk$set(echo =TRUE, eval=TRUE, cache=!TRUE, prompt=FALSE, tidy=FALSE, comment=NA, message=FALSE, warning=FALSE, results= 'markup', fig.margin=TRUE, fig.height=5, fig.width=8 )
#install.packages("dev.tools") #install.packages("dplyr") library(devtools) library(dplyr) #data handling #install_github("y-yasutomo/maliaver0") #calling package in order to analyze marine debris data library(malia0)
#Designate voyage name Vname<-"O18y1" survey.plot(read.csv(paste(Vname,".effort.csv",sep="")))
Sight.Data<-read.csv(paste(Vname,".debris.csv",sep="")) Effort.Data<-read.csv(paste(Vname,".effort.csv",sep=""))
tmp.Data<-Sight.Data %>%filter(type == "EPS") res<-MALIA(tmp.Data,Effort.Data,key="hn",td=200)
leg.D.plot(res$leg.D.obs$leg.result,xl=c(120,160),yl=c(20,50),save=F,Type="EPS")
#res<-SDAM(Voyage.name=Vname,COVARIATE = c("conv", "occo","weather", "size"), key.list = c("hn","hr", "hhn", "hhr"),td=200,cp=10) #Reading result object res<-readRDS(paste(Vname,".result.obj",sep=""))
#let's see type 'EPS' leg.D.res<-res$hhr$weather$EPS$leg.D.obs$leg.result leg.D.plot(leg.D.res,save=F,Type='EPS')
grid.D.res<-res$hhr$weather$EPS$grid.D.res grid.D.plot(grid.D.res,save=F,Type='EPS')
aic.mat<-aic.summary(res) aic.mat$EPS
best.model<-model.extract(aic.mat,res) best.model$best.mat
leg.table<-leg.D.table(best.model$best.list) head(leg.table) #write.xlsx(leg.table,file=paste(table.pass,"leg.D.table.xlsx",sep=""),row.names=F)
grid.table<-grid.D.table(best.model$best.list) head(grid.table) #write.xlsx(grid.table,file=paste(table.pass,"grid.D.table.xlsx",sep=""),row.names=F)
area.table<-area.D.table(best.model$best.list) head(area.table) #write.xlsx(area.table,file=paste(table.pass,"area.D.table.xlsx",sep=""),row.names=F)
Ar<-c("FGN","FGF","FGO","EPS","PBA","PBO","FP","PC","G","M","W","UO") Nt<-c("SW","DW","NO") An.table<-ls.(leg.table,Voyage.name,Ar,Nt) head(An.table)
Artificial.leg<-An.table %>% select(Leg.No.,Leg.Length,Lat.Start,Lon.Start,Lat.End,Lon.End,Artificial_Density) %>% rename(Density=Artificial_Density) leg.D.plot(Artificial.leg,save=F) Artificial.grid<-grid.D(Artificial.leg) grid.D.plot(Artificial.grid,save = F)
Natural.leg<-An.table %>% select(Leg.No.,Leg.Length,Lat.Start,Lon.Start,Lat.End,Lon.End,Natural_Density) %>% rename(Density=Natural_Density) leg.D.plot(Natural.leg,save=F) Natural.grid<-grid.D(Natural.leg) grid.D.plot(Natural.grid,save = F)
vname<-c("S18y4","O18y1","K18y1") tmp<-data.frame() for(i in 1:length(vname)){ Effort.Data<-read.csv(paste(vname[i],".effort.csv",sep="")) Effort.Data$voyage_name<-vname[i] tmp<-rbind(tmp,Effort.Data) } survey.plot(tmp,multi=T)
tmp<-leg.D.comb(vname) #let's see type "DW" tmp2<-grid.D(tmp$DW) grid.D.plot(tmp2,save = F) #area D tmp3<-area.D(tmp$DW) tmp3$area.density
tmp<-vanc(vname) leg.D.plot(tmp$Ar.leg.D,save=F) Artificial.grid<-grid.D(tmp$Ar.leg.D) grid.D.plot(Artificial.grid,save = F)
leg.D.plot(tmp$Nt.leg.D,save=F) Natural.grid<-grid.D(tmp$Nt.leg.D) grid.D.plot(Natural.grid,save = F)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.