[Stacomir-commits] r331 - in pkg/stacomir: R inst/examples man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 1 14:56:35 CEST 2017


Author: briand
Date: 2017-04-01 14:56:34 +0200 (Sat, 01 Apr 2017)
New Revision: 331

Added:
   pkg/stacomir/man/model-Bilan_poids_moyen-method.Rd.tex
Modified:
   pkg/stacomir/R/BilanAnnuels.r
   pkg/stacomir/R/BilanMigration.r
   pkg/stacomir/R/Bilan_poids_moyen.r
   pkg/stacomir/R/RefCoe.r
   pkg/stacomir/inst/examples/bilanAnnuels_example.R
   pkg/stacomir/inst/examples/bilan_poids_moyen_example.R
   pkg/stacomir/man/BilanAnnuels-class.Rd
   pkg/stacomir/man/Bilan_poids_moyen-class.Rd
   pkg/stacomir/man/bMM_Arzal.Rd
   pkg/stacomir/man/bM_Arzal.Rd
   pkg/stacomir/man/b_carlot.Rd
   pkg/stacomir/man/bfDC.Rd
   pkg/stacomir/man/bfDF.Rd
   pkg/stacomir/man/bilA.Rd
   pkg/stacomir/man/bilanFonctionnementDC.Rd
   pkg/stacomir/man/bilanFonctionnementDF.Rd
   pkg/stacomir/man/bilanOperation.Rd
   pkg/stacomir/man/bmi.Rd
Log:


Modified: pkg/stacomir/R/BilanAnnuels.r
===================================================================
--- pkg/stacomir/R/BilanAnnuels.r	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/R/BilanAnnuels.r	2017-04-01 12:56:34 UTC (rev 331)
@@ -483,7 +483,8 @@
 						
 					} else if (length(lestax)==1 & length(lesstd)==1){
 						
-						g<-ggplot(dat,aes(x=annee,y=effectif))+geom_point(aes(col=dc))+
+						g<-ggplot(dat,aes(x=annee,y=effectif))+
+								geom_point(aes(col=dc))+
 								geom_line(aes(col=dc))+
 								theme_bw() 
 						print(g)

Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/R/BilanMigration.r	2017-04-01 12:56:34 UTC (rev 331)
@@ -592,26 +592,41 @@
 			data=data[data$Effectif_total!=0,]
 			jour_dans_lannee_non_nuls=data$debut_pas	
 			col_a_retirer=match(c("No.pas","type_de_quantite","debut_pas","fin_pas"),colnames(data))
+			col_a_retirer=col_a_retirer[!is.na(col_a_retirer)] # car dans le cas des civelles et poids
+			# les colonnes ne sont pas les mêmes
 			data=data[,-col_a_retirer]
+			# below again the taux_d_echappement not there if glass eel and weights
+			if (is.null(data$taux_d_echappement)) data$taux_d_echappement<-NA
 			data$taux_d_echappement[data$taux_d_echappement==-1]<-NA 
-			# bug 27/02/2017 for some reasons crashes with arzal and coef_valeur_coefficient
-			# and didn't crash for logrami or smatah
 			if (!is.null(data$coe_valeur_coefficient)){
 			data$coe_valeur_coefficient[data$"coe_valeur_coefficient"==1]<-NA 
 		    }else {data$coe_valeur_coefficient<-NA}
-			peuventpaszero=match(c("taux_d_echappement","coe_valeur_coefficient"),colnames(data))
-			data[,-peuventpaszero][data[,-peuventpaszero]==0]<-NA
+			cannotbenull=match(c("taux_d_echappement","coe_valeur_coefficient"),colnames(data))
+			data[,-cannotbenull][data[,-cannotbenull]==0]<-NA
 			annee<-as.numeric(unique(strftime(as.POSIXlt(bilanMigration at time.sequence),"%Y"))[1])
-			aat_bilanmigrationjournalier_bjo=cbind(
-					bilanMigration at dc@dc_selectionne,
-					bilanMigration at taxons@data$tax_code,
-					bilanMigration at stades@data$std_code,
-					annee, # une valeur
-					rep(jour_dans_lannee_non_nuls,ncol(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","taux_d_echappement","coe_valeur_coefficient")])),
-					utils::stack(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","taux_d_echappement","coe_valeur_coefficient")]),  
-					Sys.time(),
-					substr(toupper(get("sch",envir=envir_stacomi)),1,nchar(toupper(get("sch",envir=envir_stacomi)))-1)
-			)
+			if ("Poids_total"%in%colnames(data)){
+				aat_bilanmigrationjournalier_bjo=cbind(
+						bilanMigration at dc@dc_selectionne,
+						bilanMigration at taxons@data$tax_code,
+						bilanMigration at stades@data$std_code,
+						annee, # une valeur
+						rep(jour_dans_lannee_non_nuls,ncol(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","Effectif_total.p","Effectif_total.e","poids_depuis_effectifs","Poids_total","taux_d_echappement","coe_valeur_coefficient")])),
+						utils::stack(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","Effectif_total.p","Effectif_total.e","poids_depuis_effectifs","Poids_total","taux_d_echappement","coe_valeur_coefficient")]),  
+						Sys.time(),
+						substr(toupper(get("sch",envir=envir_stacomi)),1,nchar(toupper(get("sch",envir=envir_stacomi)))-1)
+				)	
+			} else{
+				aat_bilanmigrationjournalier_bjo=cbind(
+						bilanMigration at dc@dc_selectionne,
+						bilanMigration at taxons@data$tax_code,
+						bilanMigration at stades@data$std_code,
+						annee, # une valeur
+						rep(jour_dans_lannee_non_nuls,ncol(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","taux_d_echappement","coe_valeur_coefficient")])),
+						utils::stack(data[,c("MESURE","CALCULE","EXPERT","PONCTUEL","Effectif_total","taux_d_echappement","coe_valeur_coefficient")]),  
+						Sys.time(),
+						substr(toupper(get("sch",envir=envir_stacomi)),1,nchar(toupper(get("sch",envir=envir_stacomi)))-1)
+				)	
+			}
 			aat_bilanmigrationjournalier_bjo= stacomirtools::killfactor(aat_bilanmigrationjournalier_bjo[!is.na(aat_bilanmigrationjournalier_bjo$values),])
 			colnames(aat_bilanmigrationjournalier_bjo)<-c("bjo_dis_identifiant","bjo_tax_code","bjo_std_code","bjo_annee","bjo_jour","bjo_valeur","bjo_labelquantite","bjo_horodateexport","bjo_org_code")
 			

Modified: pkg/stacomir/R/Bilan_poids_moyen.r
===================================================================
--- pkg/stacomir/R/Bilan_poids_moyen.r	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/R/Bilan_poids_moyen.r	2017-04-01 12:56:34 UTC (rev 331)
@@ -171,7 +171,7 @@
 	bilPM<-charge(bilPM)
 	bilPM<-connect(bilPM)
 	bilPM<-calcule(bilPM)
-
+	
 }
 
 
@@ -270,44 +270,46 @@
 				if (!silent) funout(gettext("object p assigned to envir_stacomi",domain="R-stacomiR"))
 			}
 		})
-		
-		
+
+
 #' Internal handler for reg, class \code{\link{Bilan_poids_moyen-class}}. 
 #' @param h handler
 #' @param \dots additional arguments passed to the function
-		hreg = function(h,...) {			
-			bilPM<-get("bilan_poids_moyen",envir=envir_stacomi)
-			model(bilPM,model.type=h$action)			
-		}
-		
+hreg = function(h,...) {			
+	bilPM<-get("bilan_poids_moyen",envir=envir_stacomi)
+	model(bilPM,model.type=h$action)			
+}
 
+
 #' model method for Bilan_poids_moyen' 
 #' this method uses samples collected over the season to model the variation in weight of
 #' glass eel or yellow eels.
 #' @param object An object of class \link{Bilan_pois_moyen-class}
 #' @param model.type default "seasonal", "seasonal1","seasonal2","manual". 
+#' @usage model(object,model.type=c("seasonal","seasonal1","seasonal2","manual"),silent=FALSE)
+#' @details 
+#' Depending on model.type several models are produced
 #' \itemize{
-#' 		\item{model.type="seasonal". The simplest model uses a seasonal variation, it is
+#'\item{model.type="seasonal".}{ The simplest model uses a seasonal variation, it is
 #' 				fitted with a sine wave curve allowing a cyclic variation 
 #' 				w ~ a*cos(2*pi*(doy-T)/365)+b with a period T. The julian time d0 used is this model is set
 #' 				at zero 1st of November d = d + d0; d0 = 305.}
-#' 		\item{model.type="seasonal1". A time component is introduced in the model, which allows
+#'\item{model.type="seasonal1".}{ A time component is introduced in the model, which allows
 #' 			for a long term variation along with the seasonal variation. This long term variation is
 #' 			is fitted with a gam, the time variable is set at zero at the beginning of the first day of observed values.
 #' 			The seasonal variation is modeled on the same modified julian time as model.type="seasonal"
 #' 			but here we use a cyclic cubic spline cc, which allows to return at the value of d0=0 at d=365.
 #' 			This model was considered as the best to model size variations by Diaz & Briand in prep. but using a large set of values
 #' 			over years.}
-#' 		\item{model.type="seasonal2". The seasonal trend in the previous model is now modelled with a sine
-#' 			curve similar to the sine curve used in seasonal.  The formula for this is \eqn{sin(\omega vt) + cos(\omega vt)}{{sin(omega vt) + cos(omega vt)}, 
+#'\item{model.type="seasonal2".}{The seasonal trend in the previous model is now modelled with a sine
+#' 			curve similar to the sine curve used in seasonal.  The formula for this is \eqn{sin(\omega vt) + cos(\omega vt)}{sin(omega vt) + cos(omega vt)}, 
 #'			where vt is the time index variable \eqn{\omega}{omega} is a constant that describes how the index variable relates to the full period
-#' 			(here, \eqn{2\pi/365=0.0172}{2pi/365=0.0172}). The model is written as following w~cos(0.0172*doy)+sin(0.0172*doy)+s(time).}
-#' 		\item{model.type="manual", The dataset don (the raw data), coe (the coefficients already present in the
+#' 			(here, \eqn{2\pi/365=0.0172}{2pi/365=0.0172}). The model is written as following \eqn{w~cos(0.0172*doy)+sin(0.0172*doy)+s(time).}}
+#'\item{model.type="manual".}{ The dataset don (the raw data), coe (the coefficients already present in the
 #' 			database, and newcoe the dataset to make the predictions from, are written to the environment envir_stacomi. 
 #' 			please see example for further description on how to fit your own model, build the table of coefficients,
-#' 			and write it to the database.}
+#' 			and write it to the database.}	
 #' }
-#' @usage model(object,model.type=c("seasonal","seasonal1","seasonal2","manual"),silent=FALSE)
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @aliases model.Bilan_poids_moyen model.bilPM
 #' @export
@@ -325,8 +327,9 @@
 				if (!"date"%in%colnames(data)) stop ("date should be in colnames(data)")
 				if (!class(data$date)[1]=="POSIXct") stop("date should be POSIXct")
 				data$year<-lubridate::year(data$date)
+				# lubridate::yday(lubridate::dmy(01082008))
 				data$yday=lubridate::yday(data$date)
-				data$doy=data$yday-305 # year begins in november				
+				data$doy=data$yday-214 # year begins in august to be consistent with the class 			
 				data$season<-stringr::str_c(lubridate::year(data$date)-1,"-",lubridate::year(data$date)) # year-1-year
 				data$season[data$doy>0]<-stringr::str_c(lubridate::year(data$date),"-",lubridate::year(data$date)+1)[data$doy>0] # for november and december it's year - year+1
 				data$yearbis<-data$year # same as season but with a numeric
@@ -363,13 +366,16 @@
 					} else predata<-rbind(predata,predatay)
 				}
 				print(result)
+				assign("result",result,envir_stacomi)
+				if (!silent) funout(gettext("Model equations assigned to envir_stacomi (result)",domain="R-stacomiR"))
+				
 				p<-ggplot(don)+ geom_jitter(aes(x=doy,y=w),col="aquamarine4")+facet_wrap(~season )+
 						geom_line(aes(x=doy,y=pred_weight),data=predata)+
 						#geom_line(aes(x=doy,y=pred_weight),color="green",size=1,data=predatafull[predatafull$doy==50,])+
 						theme_minimal()+
 						theme(panel.border = element_blank(),
 								axis.line = element_line())+
-						xlab("Jour dans la saison, debut au 1er novembre")#,
+						xlab("Jour dans la saison, debut au 1er août")#,
 				#plot.background=element_rect(fill="darkseagreen"))#,
 				#panel.background = element_rect(fill = "grey90", colour = NA))
 				
@@ -385,14 +391,14 @@
 				#points(as.POSIXct(newcoe$date),pred, col="magenta")
 				#legend("topright",c("Obs.", "Coeff base","Mod"), col=c("black","cyan","magenta"),pch="o",cex = 0.8)
 				#mtext(com,side=3,line=0.5) 
-				result
-                result_to_text<-stringr::str_c(sapply(t(result[,c(1,3,4,5)]),as.character),collapse=" ")
-						
+				
+				result_to_text<-stringr::str_c(sapply(t(result[,c(1,3,4,5)]),as.character),collapse=" ")
+				
 				# setting text for comment (lines inserted into the database)
 				com=stringr::str_c("w ~ a*cos(2*pi*(doy-T)/365)+b with a period T.",
 						" The julian time d0 used is this model is set at zero 1st of November doy = d + d0; d0 = 305.",
 						" Coefficients for the model (one line per season): season, a, T, b =",
-				result_to_text)
+						result_to_text)
 			} else if (model.type=="seasonal1"){
 				g1 = mgcv::gam(w~s(yday,bs="cc")+s(time),data=don, knots = list(yday = c(1, 365)))
 				# the knots=list(yday=c(1,365) is necessary for a smooth construction of the model
@@ -423,7 +429,7 @@
 				#	omega is a constant that describes how the index variable relates to the full period (here, 2pi/365=0.0172).
 				############################################################
 				g2 = mgcv::gam(w~cos(0.0172*doy)+sin(0.0172*doy)+s(time),data=don)
-				print(gettext("One model per year, doy starts in november",domain="R-stacomiR"))
+				print(gettext("One model per year, doy starts in august",domain="R-stacomiR"))
 				summary(g2)
 				plot(g2,pages=1)
 				predata<-newcoe
@@ -444,7 +450,7 @@
 				assign("g2",g2,envir=envir_stacomi)
 				if (!silent) funout(gettext("ggplot object p assigned to envir_stacomi",domain="R-stacomiR"))
 				if (!silent) funout(gettext("gam model g2 assigned to envir_stacomi",domain="R-stacomiR"))
-					
+				
 				###################################################################
 				# comparison with Guerault and Desaunay (summary table in latex)
 				######################################################################
@@ -458,7 +464,7 @@
 				colnames(summary_harmonic)=c("source","$\\gamma$","$s_0(cm)$","$\\phi$")
 				xt_summary_harmonic<-xtable( summary_harmonic,
 						caption=gettext("Comparison of the coefficients obtained by \\citet{desaunay_seasonal_1997} and in the present modelling
-								of estuarine samples.",domain="R-stacomiR"),
+										of estuarine samples.",domain="R-stacomiR"),
 						label=gettext("summary_harmonic",domain="R-stacomiR"),
 						digits=c(0,0,3,3,0))
 				tabname<-stringr::str_c(get("datawd",envir=envir_stacomi),"/summary_harmonic.tex")
@@ -485,24 +491,26 @@
 				assign("coe",coe,envir=envir_stacomi)
 			}
 			
-		
-			import_coe=data.frame(
-					"coe_tax_code"='2038',
-					"coe_std_code"='CIV',
-					"coe_qte_code"=1,
-					"coe_date_debut"=Hmisc::round.POSIXt(predata$date,digits="days"),
-					"coe_date_fin"=Hmisc::round.POSIXt(predata$date,digits="days")+as.difftime(1,units="days"),
-					"coe_valeur_coefficient"=1/predata$pred_weight,
-					"coe_commentaires"=com)
-			# will write only if the database is present
-			if (get("database_expected",envir_stacomi)){
-			fileout= paste(get("datawd",envir=envir_stacomi),"import_coe",bilPM at anneedebut@annee_selectionnee,bilPM at anneefin@annee_selectionnee,".csv",sep="")
-			utils::write.table(import_coe,file=fileout, row.names = FALSE,sep=";")
-			funout(paste(gettextf("data directory :%s",fileout,domain="R-stacomiR")))
+			if (model.type!="manual"){
+				import_coe=data.frame(
+						"coe_tax_code"='2038',
+						"coe_std_code"='CIV',
+						"coe_qte_code"=1,
+						"coe_date_debut"=Hmisc::round.POSIXt(predata$date,digits="days"),
+						"coe_date_fin"=Hmisc::round.POSIXt(predata$date,digits="days")+as.difftime(1,units="days"),
+						"coe_valeur_coefficient"=1/predata$pred_weight,
+						"coe_commentaires"=com)
+				# will write only if the database is present
+				if (get("database_expected",envir_stacomi)){
+					fileout= paste(get("datawd",envir=envir_stacomi),"import_coe",bilPM at anneedebut@annee_selectionnee,bilPM at anneefin@annee_selectionnee,".csv",sep="")
+					utils::write.table(import_coe,file=fileout, row.names = FALSE,sep=";")
+					funout(paste(gettextf("data directory :%s",fileout,domain="R-stacomiR")))
+				}
+				assign("import_coe",import_coe,envir=envir_stacomi)
+				funout(gettext("To obtain the table, type : import_coe=get(import_coe\",envir_stacomi",domain="R-stacomiR"))
+				bilPM at calcdata[["import_coe"]]<-import_coe	
 			}
-			assign("import_coe",import_coe,envir=envir_stacomi)
-			funout(gettext("To obtain the table, type : import_coe=get(import_coe\",envir_stacomi",domain="R-stacomiR"))
-					bilPM at calcdata[["import_coe"]]<-import_coe			
+			return(bilPM)
 		})
 
 
@@ -547,11 +555,13 @@
 			# first delete existing data from the database
 			supprime(bilPM at coe,tax=2038,std="CIV")
 			import_coe<-bilPM at calcdata$import_coe
+			import_coe$coe_org_code<-toupper(gsub("\\.","",get("sch",envir_stacomi)))
 			baseODBC<-get("baseODBC",envir=envir_stacomi)
 			sql<-stringr::str_c("INSERT INTO ",get("sch",envir=envir_stacomi),"tj_coefficientconversion_coe (",			
 					"coe_tax_code,coe_std_code,coe_qte_code,coe_date_debut,coe_date_fin,coe_valeur_coefficient,
-							coe_commentaires)",
-					" SELECT * FROM import_coe;")
+							coe_commentaires,coe_org_code)",
+					" SELECT coe_tax_code,coe_std_code,coe_qte_code,coe_date_debut,coe_date_fin,coe_valeur_coefficient::real,
+							coe_commentaires,coe_org_code FROM import_coe;")
 			invisible(utils::capture.output(
 							sqldf::sqldf(x=sql,
 									drv="PostgreSQL",

Modified: pkg/stacomir/R/RefCoe.r
===================================================================
--- pkg/stacomir/R/RefCoe.r	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/R/RefCoe.r	2017-04-01 12:56:34 UTC (rev 331)
@@ -44,7 +44,7 @@
 			requete at colonnefin="coe_date_fin"
 			# the coefficients are only loaded for bilanMigration
 			# to be consistent with current programming, we need to add it as a timestamp
-			requete at datefin=as.POSIXlt(object at datefin)+as.difftime("23:59:59")		
+			requete at datefin=as.POSIXlt(object at datefin+as.difftime("23:59:59"))		
 			requete at select=stringr::str_c("select * from ",
 					get("sch",envir=envir_stacomi),
 					"tj_coefficientconversion_coe")

Modified: pkg/stacomir/inst/examples/bilanAnnuels_example.R
===================================================================
--- pkg/stacomir/inst/examples/bilanAnnuels_example.R	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/inst/examples/bilanAnnuels_example.R	2017-04-01 12:56:34 UTC (rev 331)
@@ -5,7 +5,6 @@
 		database_expected=FALSE)
 # the following script will load the Arzal dataset if connected to iav schema
 \dontrun{
-	#create an instance of the class
 	baseODBC<-get("baseODBC",envir=envir_stacomi)
 	baseODBC[c(2,3)]<-rep("iav",2)
 	assign("baseODBC",baseODBC,envir_stacomi)
@@ -23,6 +22,7 @@
 }
 # the following dataset has been generated by the previous code
 data(bilA)
+(bilA)
 xtbilA<-xtable(bilA,
 		dc_name=c("Passe bassins","Piege anguille RG","Piege anguille RD"),
 		tax_name="Anguille",

Modified: pkg/stacomir/inst/examples/bilan_poids_moyen_example.R
===================================================================
--- pkg/stacomir/inst/examples/bilan_poids_moyen_example.R	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/inst/examples/bilan_poids_moyen_example.R	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,8 +3,6 @@
 stacomi(gr_interface=FALSE,
 		login_window=FALSE,
 		database_expected=FALSE)
-# the following script will load data from the two Anguillere monitored in the Somme
-
 \dontrun{
 	#create an instance of the class
 	bilPM<-new("Bilan_poids_moyen")

Modified: pkg/stacomir/man/BilanAnnuels-class.Rd
===================================================================
--- pkg/stacomir/man/BilanAnnuels-class.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/BilanAnnuels-class.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -31,7 +31,6 @@
 		database_expected=FALSE)
 # the following script will load the Arzal dataset if connected to iav schema
 \dontrun{
-	#create an instance of the class
 	baseODBC<-get("baseODBC",envir=envir_stacomi)
 	baseODBC[c(2,3)]<-rep("iav",2)
 	assign("baseODBC",baseODBC,envir_stacomi)
@@ -49,6 +48,7 @@
 }
 # the following dataset has been generated by the previous code
 data(bilA)
+(bilA)
 xtbilA<-xtable(bilA,
 		dc_name=c("Passe bassins","Piege anguille RG","Piege anguille RD"),
 		tax_name="Anguille",

Modified: pkg/stacomir/man/Bilan_poids_moyen-class.Rd
===================================================================
--- pkg/stacomir/man/Bilan_poids_moyen-class.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/Bilan_poids_moyen-class.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -42,8 +42,6 @@
 stacomi(gr_interface=FALSE,
 		login_window=FALSE,
 		database_expected=FALSE)
-# the following script will load data from the two Anguillere monitored in the Somme
-
 \dontrun{
 	#create an instance of the class
 	bilPM<-new("Bilan_poids_moyen")

Modified: pkg/stacomir/man/bMM_Arzal.Rd
===================================================================
--- pkg/stacomir/man/bMM_Arzal.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bMM_Arzal.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,7 +3,7 @@
 \docType{data}
 \name{bMM_Arzal}
 \alias{bMM_Arzal}
-\title{An object of class bilanMigrationMult with data loaded}
+\title{Anguilla migration at the Arzal station (BilanMigrationMult-class)}
 \format{An object of class bilanMigrationMult with slots:
 \describe{
   \item{dc}{the \code{RefDC} object filled with data}

Modified: pkg/stacomir/man/bM_Arzal.Rd
===================================================================
--- pkg/stacomir/man/bM_Arzal.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bM_Arzal.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,7 +3,7 @@
 \docType{data}
 \name{bM_Arzal}
 \alias{bM_Arzal}
-\title{An object of class bilanMigration with data loaded}
+\title{Video counting of thin lipped mullet (Liza ramada) in 2015 on the Vilaine (France)}
 \format{An object of class bilanMigration with 8 slots:
 \describe{
   \item{dc}{the \code{RefDC} object with 4 slots filled with data corresponding to the iav postgres schema}

Modified: pkg/stacomir/man/b_carlot.Rd
===================================================================
--- pkg/stacomir/man/b_carlot.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/b_carlot.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,8 +3,8 @@
 \docType{data}
 \name{b_carlot}
 \alias{b_carlot}
-\title{An object of class \link{Bilan_carlot-class} with data loaded}
-\format{An object of class Bilan_carlot}
+\title{Size of yellow and glass eel at the Arzal dam (Vilaine, France) in the fishway and main eel trapping ladder.}
+\format{An object of class \link{Bilan_carlot-class}}
 \usage{
 b_carlot
 }

Modified: pkg/stacomir/man/bfDC.Rd
===================================================================
--- pkg/stacomir/man/bfDC.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bfDC.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,7 +3,7 @@
 \docType{data}
 \name{bfDC}
 \alias{bfDC}
-\title{An object of class \link{BilanFonctionnementDC-class} with data loaded}
+\title{Counting Device (DC) operation from 2000 to 2015 at the Arzal dam (Vilaine, France)}
 \format{An object of class BilanFonctionnementDC with 4 slots:
 \describe{
 #'   \item{data}{ A dataframe with 544 obs. of  7 variables
@@ -32,7 +32,8 @@
 }
 \description{
 This data corresponds to the data collected at the vertical slot fishway camera
-from 2000 to 2015.
+from 2000 to 2015. It represents an object of class \link{BilanFonctionnementDC-class} 
+with data loaded
 }
 \keyword{data}
 

Modified: pkg/stacomir/man/bfDF.Rd
===================================================================
--- pkg/stacomir/man/bfDF.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bfDF.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,7 +3,7 @@
 \docType{data}
 \name{bfDF}
 \alias{bfDF}
-\title{An object of class \link{BilanFonctionnementDF-class} with data loaded}
+\title{Overview of the fishway operation at Arzal in (Vilaine France).}
 \format{An object of class BilanFonctionnementDF with 4 slots:
 \describe{
 #'   \item{data}{ A dataframe with 4261 obs. of  7 variables
@@ -31,7 +31,8 @@
 }
 \description{
 This data corresponds to the data collected at the vertical slot fishway
-in 2015, the fishway is working daily with a cycle depending on tide.
+in 2015, the fishway is working daily with a cycle depending on tide. This dataset
+is used to show an example of acdetailed output for an object of class \link{BilanFonctionnementDF-class} with data loaded
 }
 \keyword{data}
 

Modified: pkg/stacomir/man/bilA.Rd
===================================================================
--- pkg/stacomir/man/bilA.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bilA.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,7 +3,8 @@
 \docType{data}
 \name{bilA}
 \alias{bilA}
-\title{An object of class \link{BilanAnnuels-class} with data loaded}
+\title{Annual migration of yellow and silver eel for three fishways / counting devices at the
+Arzal dam (data from 1995 to 2016)}
 \format{An object of class \link{BilanAnnuels-class} with data slot loaded.}
 \usage{
 bilA

Modified: pkg/stacomir/man/bilanFonctionnementDC.Rd
===================================================================
--- pkg/stacomir/man/bilanFonctionnementDC.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bilanFonctionnementDC.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,13 +3,14 @@
 \docType{data}
 \name{bilanFonctionnementDC}
 \alias{bilanFonctionnementDC}
-\title{An object of class \link{BilanFonctionnementDC-class} with data loaded}
+\title{Counting device operation for three different counting device in Arzal (Vilaine, France)}
 \format{An object of class BilanFonctionnementDC}
 \usage{
 bilanFonctionnementDC
 }
 \description{
-This dataset corresponds to the data collected at three different control devices
+This dataset corresponds to the data collected at three different control devices.
+This object is of class \link{BilanFonctionnementDC-class} with data loaded
 it is loaded along with \link{bMM_Arzal}
 }
 \keyword{data}

Modified: pkg/stacomir/man/bilanFonctionnementDF.Rd
===================================================================
--- pkg/stacomir/man/bilanFonctionnementDF.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bilanFonctionnementDF.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,8 +3,8 @@
 \docType{data}
 \name{bilanFonctionnementDF}
 \alias{bilanFonctionnementDF}
-\title{An object of class \link{BilanFonctionnementDF-class} with data loaded}
-\format{An object of class BilanFonctionnementDF}
+\title{Fishway operation at the Arzal Dam (Vilaine France) (3 Fishways in 2011)}
+\format{An object of class BilanFonctionnementDF  \link{BilanFonctionnementDF-class}}
 \usage{
 bilanFonctionnementDF
 }

Modified: pkg/stacomir/man/bilanOperation.Rd
===================================================================
--- pkg/stacomir/man/bilanOperation.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bilanOperation.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,13 +3,14 @@
 \docType{data}
 \name{bilanOperation}
 \alias{bilanOperation}
-\title{An object of class \link{BilanOperation-class} with data loaded}
+\title{Counting operations for three different counting device in Arzal (Vilaine, France)}
 \format{An object of class BilanOperation}
 \usage{
 bilanOperation
 }
 \description{
 This dataset corresponds to the data collected at three different control devices
+It is an object of class \link{BilanOperation-class} with data loaded.
 it is loaded along with \link{bMM_Arzal}
 }
 \keyword{data}

Modified: pkg/stacomir/man/bmi.Rd
===================================================================
--- pkg/stacomir/man/bmi.Rd	2017-03-30 18:28:22 UTC (rev 330)
+++ pkg/stacomir/man/bmi.Rd	2017-04-01 12:56:34 UTC (rev 331)
@@ -3,8 +3,8 @@
 \docType{data}
 \name{bmi}
 \alias{bmi}
-\title{An object of class \link{BilanMigrationInterAnnuelle-class} with data loaded}
-\format{An object of class BilanMigrationInterAnnuelle-class with data slot loaded.}
+\title{Daily glass eel and elver migration from 1984 to 2016 in the Sèvre Niortaise}
+\format{An object of class \ref{BilanMigrationInterAnnuelle-class} with data loaded.}
 \usage{
 bmi
 }

Added: pkg/stacomir/man/model-Bilan_poids_moyen-method.Rd.tex
===================================================================
--- pkg/stacomir/man/model-Bilan_poids_moyen-method.Rd.tex	                        (rev 0)
+++ pkg/stacomir/man/model-Bilan_poids_moyen-method.Rd.tex	2017-04-01 12:56:34 UTC (rev 331)
@@ -0,0 +1,51 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/Bilan_poids_moyen.r
+\docType{methods}
+\name{model,Bilan_poids_moyen-method}
+\alias{model,Bilan_poids_moyen-method}
+\alias{model.Bilan_poids_moyen}
+\alias{model.bilPM}
+\title{model method for Bilan_poids_moyen' 
+this method uses samples collected over the season to model the variation in weight of
+glass eel or yellow eels.}
+\usage{
+model(object,model.type=c("seasonal","seasonal1","seasonal2","manual"),silent=FALSE)
+}
+\arguments{
+\item{object}{An object of class \link{Bilan_pois_moyen-class}}
+
+\item{model.type}{default "seasonal", "seasonal1","seasonal2","manual".}
+}
+\description{
+model method for Bilan_poids_moyen' 
+this method uses samples collected over the season to model the variation in weight of
+glass eel or yellow eels.
+}
+\details{
+Depending on model.type several models are produced
+\itemize{
+		\item{model.type="seasonal".}{ The simplest model uses a seasonal variation, it is
+				fitted with a sine wave curve allowing a cyclic variation 
+				w ~ a*cos(2*pi*(doy-T)/365)+b with a period T. The julian time d0 used is this model is set
+				at zero 1st of November d = d + d0; d0 = 305.}
+	\item{model.type="seasonal1".}{ A time component is introduced in the model, which allows
+			for a long term variation along with the seasonal variation. This long term variation is
+			is fitted with a gam, the time variable is set at zero at the beginning of the first day of observed values.
+			The seasonal variation is modeled on the same modified julian time as model.type="seasonal"
+			but here we use a cyclic cubic spline cc, which allows to return at the value of d0=0 at d=365.
+			This model was considered as the best to model size variations by Diaz & Briand in prep. but using a large set of values
+			over years.}
+\item{model.type="seasonal2"}{The seasonal trend in the previous model is now modelled with a sine
+			curve similar to the sine curve used in seasonal.  The formula for this is \eqn{sin(\omega vt) + cos(\omega vt)}{sin(omega vt) + cos(omega vt)}, 
+		where vt is the time index variable \eqn{\omega}{omega} is a constant that describes how the index variable relates to the full period
+			(here, \eqn{2\pi/365=0.0172}{2pi/365=0.0172}. The model is written as following \eqn{w~cos(0.0172*doy)+sin(0.0172*doy)+s(time).}}
+	\item{model.type="manual"}{ The dataset don (the raw data), coe (the coefficients already present in the
+			database, and newcoe the dataset to make the predictions from, are written to the environment envir_stacomi. 
+			please see example for further description on how to fit your own model, build the table of coefficients,
+			and write it to the database.}	
+}
+}
+\author{
+Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+}
+



More information about the Stacomir-commits mailing list