[Stacomir-commits] r402 - in pkg/stacomir: R inst/config inst/tests/testthat man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 20 13:03:56 CEST 2017


Author: briand
Date: 2017-06-20 13:03:56 +0200 (Tue, 20 Jun 2017)
New Revision: 402

Added:
   pkg/stacomir/inst/tests/testthat/test-08-report_silver_eel.R
   pkg/stacomir/inst/tests/testthat/test-50-spell_checking.R
Removed:
   pkg/stacomir/inst/tests/testthat/test-08-report_silver.R
Modified:
   pkg/stacomir/R/data.R
   pkg/stacomir/R/interface_report_species.R
   pkg/stacomir/R/ref_checkbox.R
   pkg/stacomir/R/ref_par.R
   pkg/stacomir/R/ref_parqual.R
   pkg/stacomir/R/ref_period.R
   pkg/stacomir/R/report_dc.R
   pkg/stacomir/R/report_df.R
   pkg/stacomir/R/report_env.R
   pkg/stacomir/R/report_ge_weight.R
   pkg/stacomir/R/report_mig.R
   pkg/stacomir/R/report_mig_char.R
   pkg/stacomir/R/report_mig_interannual.R
   pkg/stacomir/R/report_mig_mult.R
   pkg/stacomir/R/report_sample_char.R
   pkg/stacomir/R/report_sea_age.R
   pkg/stacomir/R/report_silver_eel.R
   pkg/stacomir/R/utilities.R
   pkg/stacomir/inst/config/generate_Roxygen2.R
   pkg/stacomir/inst/config/generate_data.R
   pkg/stacomir/inst/config/stacomi_checks.R
   pkg/stacomir/inst/config/testthat.R
   pkg/stacomir/inst/tests/testthat/test-00-stacomir.R
   pkg/stacomir/inst/tests/testthat/test-06-report_mig_interannual.R
   pkg/stacomir/inst/tests/testthat/test-12-report_mig_char.R
   pkg/stacomir/man/charge-ref_checkbox-method.Rd
   pkg/stacomir/man/charge-report_dc-method.Rd
   pkg/stacomir/man/choice-ref_checkbox-method.Rd
   pkg/stacomir/man/fun_report_mig_interannual.Rd
   pkg/stacomir/man/quitte.Rd
   pkg/stacomir/man/r_gew.Rd
   pkg/stacomir/man/ref_par-class.Rd
   pkg/stacomir/man/ref_period-class.Rd
   pkg/stacomir/man/report_df-class.Rd
   pkg/stacomir/man/report_ge_weight-class.Rd
   pkg/stacomir/man/report_mig_char-class.Rd
   pkg/stacomir/man/report_sample_char-class.Rd
   pkg/stacomir/man/report_silver_eel-class.Rd
   pkg/stacomir/man/write_database-report_sea_age-method.Rd
Log:


Modified: pkg/stacomir/R/data.R
===================================================================
--- pkg/stacomir/R/data.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/data.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -288,7 +288,7 @@
 
 #' Wet weight of glass eel from the trapping ladder (Arzal, Vilaine France) 
 #' 
-#' Data correspond to glass eel collected in the VIlaine at the trapping ladder (Arzal, France). The years selected are 2009 to 2012,
+#' Data correspond to glass eel collected in the Vilaine at the trapping ladder (Arzal, France). The years selected are 2009 to 2012,
 #' the query used in the \link{report_ge_weight-class} loads from 2008-08-01 to 2012-08-01
 #' Glass eel are too numerous to be counted. They are weighted and in the stacomi database,
 #' a table with daily coefficients (in  N glass eel/g) to transform weight into number.

Modified: pkg/stacomir/R/interface_report_species.R
===================================================================
--- pkg/stacomir/R/interface_report_species.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/interface_report_species.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -1,4 +1,4 @@
-#' Interface for reportEspece class
+#' Interface for report_species class
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @keywords internal
 interface_report_species=function(){

Modified: pkg/stacomir/R/ref_checkbox.R
===================================================================
--- pkg/stacomir/R/ref_checkbox.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/ref_checkbox.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -12,7 +12,7 @@
 setClass(Class="ref_checkbox",representation= representation(title="character",labels="character",checked="logical"),
 	prototype=prototype(title="liste de choice",labels="choice",checked=FALSE))
 
-#' Loading method for ReCheckBox referential objects
+#' Loading method for ref_checkbox referential objects
 #' @param object An object of class \link{ref_checkbox-class}
 #' @param title Title of the frame
 #' @param labels Labels for checked
@@ -31,7 +31,7 @@
 	  object at checked=checked
 	  return(object)
 	})
-#' Choice method for ReCheckBox referential objects
+#' Choice method for ref_checkbox referential objects
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @param object An object of class \link{ref_checkbox-class}
 #' @examples 

Modified: pkg/stacomir/R/ref_par.R
===================================================================
--- pkg/stacomir/R/ref_par.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/ref_par.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -8,31 +8,27 @@
 #' Class enabling to load the list of parameters and select one of them
 #' @include create_generic.R
 #' @slot data A data.frame
-#' @slot par_selectionne A character vector corresponding to par_code
+#' @slot par_selected A character vector corresponding to par_code
 #' @section Objects from the Class: Objects can be created by calls of the form
-#' \code{new("ref_par", data)}.  \describe{ \item{list("data")}{Object of class
-#' \code{"data.frame"} ~ All the parameters stored in the
-#' database}\item{:}{Object of class \code{"data.frame"} ~ All the parameters
-#' stored in the database} }
 #' @author cedric.briand"at"eptb-vilaine.fr
 #' @keywords classes
 #' @slot data="data.frame" the list of parameters
 #' @family referential objects
-setClass(Class="ref_par",representation= representation(data="data.frame",par_selectionne="character"))
+setClass(Class="ref_par",representation= representation(data="data.frame",par_selected="character"))
 
 
 setValidity("ref_par",method=function(object){
-	  if (length(object at par_selectionne)!=0){		
+	  if (length(object at par_selected)!=0){		
 		if (nrow(object at data)>0) {
-		  concord<-object at par_selectionne%in%object at data$par_code					
+		  concord<-object at par_selected%in%object at data$par_code					
 		  if (any(!concord)){
-			return(paste("No data for par",object at par_selectionne[!concord]))
+			return(paste("No data for par",object at par_selected[!concord]))
 			
 		  } else {
 			return(TRUE)
 		  }
 		} else {
-		  return("You tried to set a value for par_selectionne without initializing the data slot")
+		  return("You tried to set a value for par_selected without initializing the data slot")
 		}
 	  }  else return(TRUE)
 	  
@@ -116,7 +112,7 @@
 	  if (nrow(object at data) > 0){
 		hcar=function(h,...){
 		  carchoisi=svalue(choice)
-		  object at par_selectionne<-object at data[car_libelle%in%carchoisi ,"par_code"]
+		  object at par_selected<-object at data[car_libelle%in%carchoisi ,"par_code"]
 		  #object at data<-object at data[car_libelle%in%carchoisi ,"par_code"]
 		  assign(nomassign,object,envir_stacomi)
 		  funout(gettext("Feature has been selected\n",domain="R-stacomiR"))
@@ -149,17 +145,17 @@
 		par<-as.character(par) 
 	  }
 	  if (any(is.na(par))) stop ("NA values par")			
-	  object at par_selectionne<-par				
+	  object at par_selected<-par				
 	  if (nrow(object at data)==0){
-		stop ("Internal error : tried to set a value for par_selectionne without initializing the data slot")
+		stop ("Internal error : tried to set a value for par_selected without initializing the data slot")
 	  }
 	  #validObject(object,test=FALSE) 
 	  #here I don't want to generate an error if parm is not present
 	  #so I'm not using the validObject which will throw and error
-	  concord<-object at par_selectionne%in%object at data$par_code	
+	  concord<-object at par_selected%in%object at data$par_code	
 	  
 	  if (any(!concord)){
-		warning(paste(gettextf("No data for par %s",object at par_selectionne[!concord],domain="R-stacomiR")))
+		warning(paste(gettextf("No data for par %s",object at par_selected[!concord],domain="R-stacomiR")))
 	  }
 	  
 	  assign("ref_par",object,envir=envir_stacomi)
@@ -193,7 +189,7 @@
 	  if (nrow(object at data) > 0){
 		hpar=function(h,...){
 		  parm=tbdestpar[,][tbdestpar[,]!=""]
-		  object at par_selectionne<-object at data[car_libelle%in%parm,"par_code"]
+		  object at par_selected<-object at data[car_libelle%in%parm,"par_code"]
 		  assign(nomassign,object,envir_stacomi)
 		  funout(gettext("Parameter selected\n",domain="R-stacomiR"))
 		  if (!is.null(objectreport)) {

Modified: pkg/stacomir/R/ref_parqual.R
===================================================================
--- pkg/stacomir/R/ref_parqual.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/ref_parqual.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -2,15 +2,6 @@
 #' 
 #' Class enabling to load the list of qualitative parameters and to select one
 #' of them. It inherits from 'ref_par', uses its 'choice' method
-#' 
-#' 
-#' @section Objects from the Class: Objects can be created by calls of the form
-#' \code{new("ref_parqual", ...)}.  \describe{ \item{list("valqual")}{Object of
-#' class \code{"data.frame"} Values of qualitatives parameters}\item{:}{Object
-#' of class \code{"data.frame"} Values of qualitatives parameters}
-#' \item{list("data")}{Object of class \code{"data.frame"} Qualitatives
-#' parameters }\item{:}{Object of class \code{"data.frame"} Qualitatives
-#' parameters } }
 #' @author cedric.briand"at"eptb-vilaine.fr
 #' @slot valqual="data.frame" the list of qualitative parameters
 #' @include ref_par.R
@@ -89,7 +80,7 @@
 	  requete=new("RequeteODBC")
 	  requete at baseODBC<-get("baseODBC",envir=envir_stacomi)
 	  requete at sql= paste("select * from ref.tr_valeurparametrequalitatif_val",
-		  " WHERE val_qal_code in ", vector_to_listsql(object at par_selectionne),
+		  " WHERE val_qal_code in ", vector_to_listsql(object at par_selected),
 		  " ORDER BY val_rang",sep="")
 	  requete<-stacomirtools::connect(requete)
 	  #funout(gettext("The query to load parameters is done \n",domain="R-stacomiR"))
@@ -157,7 +148,7 @@
 		hpar=function(h,...){
 		  parm=tbdestpar[,][tbdestpar[,]!=""]
 		  if (length(parm)>0){
-			object at par_selectionne<-object at data[car_libelle%in%parm ,"par_code"]
+			object at par_selected<-object at data[car_libelle%in%parm ,"par_code"]
 			# below the line that changes from the ref_par
 			object<-charge_complement(object)
 			assign(nomassign,object,envir_stacomi)

Modified: pkg/stacomir/R/ref_period.R
===================================================================
--- pkg/stacomir/R/ref_period.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/ref_period.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -4,7 +4,7 @@
 #' 
 #' ref_period referential class to choose a period
 #' 
-#' @note pgval are used by seq.POSIXT
+#' @note pgval are used by seq.POSIXt
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("ref_period", ...)}.
 #' @keywords classes

Modified: pkg/stacomir/R/report_dc.R
===================================================================
--- pkg/stacomir/R/report_dc.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_dc.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -67,7 +67,7 @@
 
 #' charge method for report_dc
 #' 
-#' used by the graphical interface to retreive the objects of referential classes
+#' used by the graphical interface to retrieve the objects of referential classes
 #' assigned to envir_stacomi
 #' @param object An object of class \link{report_dc-class}
 #' @param silent boolean, default FALSE, if TRUE messages are not displayed.

Modified: pkg/stacomir/R/report_df.R
===================================================================
--- pkg/stacomir/R/report_df.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_df.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -4,7 +4,7 @@
 #' to more complex fishways with levels adjusted by the opening of various gates and regulators. 
 #' The objective of this class is to provide an assessment of the working status of a fishway throughout the year.
 #' A number of fishes ascending a fishway has meaning only if we know that the fishway is operational, and that the counting 
-#' orerated on the fishway has remained operational.
+#' operated on the fishway has remained operational.
 #' In the database the operation of the fishway (DF) and counting device (DC) is agregated in one table (t_periodefonctdispositif_per).
 #' The column  per_etat_fonctionnement indicates whether the fishway is operational (with a boolean) and the column per_tar_code indicates
 #' the status of either the fishway or DC. In the database four types of operation are set,  "1"=normal operation,

Modified: pkg/stacomir/R/report_env.R
===================================================================
--- pkg/stacomir/R/report_env.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_env.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -98,7 +98,7 @@
 		  silent=silent)
 	  return(r_env)
 	})
-#' charge method for reportCondtionEnv class
+#' charge method for report_env class
 #' @param object An object of class \link{report_env-class}
 #' @param silent Default FALSE, if TRUE the program should no display messages
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}

Modified: pkg/stacomir/R/report_ge_weight.R
===================================================================
--- pkg/stacomir/R/report_ge_weight.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_ge_weight.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -1,7 +1,7 @@
 #' Trend of wet weight in glass eel
 #' 
 #' In trapping ladders, glass eel are seldom counted, as they are too tiny to handle and too numerous to count.
-#' The usuall operation is to weight them, or to use a bucket to measure their volume. These weights or volumes will later
+#' The usual operation is to weight them, or to use a bucket to measure their volume. These weights or volumes will later
 #' need to be converted to numbers. The glass eel weight may follow a seasonal pattern. It's the case for Anguilla anguilla 
 #' glass eel in the Bay of Biscay. Weights can be modelled using sine wave curves, or more complex gam models. 
 #' This class has a model method to try those models, which can also be used to extact coefficients manually
@@ -24,7 +24,7 @@
 #' @slot coe Object of class \code{\link{ref_coe-class}} class loading coefficient
 #' of conversion between quantity (weights or volumes of glass eel) and numbers
 #' @slot liste Object of class \code{\link{ref_list-class}} ref_list referential
-#' class choose within a list, here the choice is wether subsamples or not. Subsamples
+#' class choose within a list, here the choice is whether subsamples or not. Subsamples
 #' in the stacomi database are samples with a non null value for parent sample. Migration
 #' counts are never made on subsamples but those can be integrated to calculate mean weights.
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}

Modified: pkg/stacomir/R/report_mig.R
===================================================================
--- pkg/stacomir/R/report_mig.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_mig.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -351,7 +351,7 @@
 #' Plots of various type for report_mig.
 #' 
 #' \itemize{
-#' 		\item{plot.type="standard"}{calls \code{\link{fungraph}} and \code{\link{fungraph_glasseel}} functions to plot as many "reportmigration"
+#' 		\item{plot.type="standard"}{calls \code{\link{fungraph}} and \code{\link{fungraph_glasseel}} functions to plot as many "report_mig"
 #' 			as needed, the function will test for the existence of data for one dc, one taxa, and one stage}
 #' 		\item{plot.type="step"}{creates Cumulated graphs for report_mig_mult.  Data are summed per day for different dc taxa and stages}
 #' 		\item{plot.type="multiple"}{Method to overlay graphs for report_mig_mult (multiple dc/taxa/stage in the same plot)}
@@ -684,8 +684,6 @@
       
 	  
 	  hconfirm=function(h,...){			
-		# suppression des donnees actuellement presentes dans la base
-		# reportjournalier et reportmensuel
 		if (check_for_bjo) supprime(bil)			
 		baseODBC<-get("baseODBC",envir=envir_stacomi)
 		sql<-stringr::str_c("INSERT INTO ",get("sch",envir=envir_stacomi),"t_bilanmigrationjournalier_bjo (",			

Modified: pkg/stacomir/R/report_mig_char.R
===================================================================
--- pkg/stacomir/R/report_mig_char.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_mig_char.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -27,7 +27,7 @@
 #' @slot par An object of class \link{ref_par-class} inherited from \link{report_sample_char-class}
 #' @slot echantillon An object of class \link{ref_choice-class}, vector of choice
 #' @slot parquan An object of class \link{ref_parquan-class}, quantitative parameter 
-#' @slot parqual An object of class \link{ref_parqual-class}, quanlitative parameter
+#' @slot parqual An object of class \link{ref_parqual-class}, qualitative parameter
 #' @family report Objects
 #' @aliases report_mig_char
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
@@ -211,8 +211,8 @@
 		echantillons=""      
 	  } 
 	  # data can be selected but not in the database or the inverse
-	  parquan<-intersect(r_mig_char at parquan@par_selectionne,r_mig_char at parquan@data$par_code)
-	  parqual<-intersect(r_mig_char at parqual@par_selectionne,r_mig_char at parqual@data$par_code)
+	  parquan<-intersect(r_mig_char at parquan@par_selected,r_mig_char at parquan@data$par_code)
+	  parqual<-intersect(r_mig_char at parqual@par_selected,r_mig_char at parqual@data$par_code)
 	  if (length(parquan)==0 & length(parqual)==0) {
 		stop("You need to choose at least one quantitative or qualitative attribute")
 	  } else {
@@ -278,7 +278,9 @@
 	})
 
 
-#' handler for reportmigrationpar
+#' handler for report_mig_char
+#' 
+#' internal use
 #' @param h handler
 #' @param ... Additional parameters
 #' @keywords internal
@@ -303,7 +305,7 @@
 	  #========= initial checks ================
 	  if (class(par)!="character") stop("par should be a character")
 	  if (nrow(r_mig_char at data[["parquan"]])==0)  funout(gettext("No data for quantitative parameter, perhaps you forgot to run the calcule method"))
-	  if (!par%in%r_mig_char at parquan@par_selectionne) funout(gettextf("The parameter %s is not in the selected parameters",par),arret=TRUE)
+	  if (!par%in%r_mig_char at parquan@par_selected) funout(gettextf("The parameter %s is not in the selected parameters",par),arret=TRUE)
 	  if (!par%in%r_mig_char at parquan@data$par_code) funout(gettextf("No data for this parameter, nothing to do",par),arret=TRUE)
 	  #=============================================
 	  tab<-r_mig_char at data[["parquan"]]
@@ -315,9 +317,9 @@
 	  r_mig_char at data[["parquan"]]<-r_mig_char at data[["parquan"]][!lignes_du_par,]
 	  r_mig_char at data[["parqual"]]<-rbind(r_mig_char at data[["parqual"]],tab)
 	  # Adding the par to parqual
-	  r_mig_char at parqual@par_selectionne<-c(r_mig_char at parqual@par_selectionne,par)
+	  r_mig_char at parqual@par_selected<-c(r_mig_char at parqual@par_selected,par)
 	  # removing from parquan
-	  r_mig_char at parquan@par_selectionne<-r_mig_char at parquan@par_selectionne[-match(par,r_mig_char at parquan@par_selectionne)]
+	  r_mig_char at parquan@par_selected<-r_mig_char at parquan@par_selected[-match(par,r_mig_char at parquan@par_selected)]
 	  # resetting the right values for valqual
 	  r_mig_char at parqual@valqual<-rbind(r_mig_char at parqual@valqual,
 		  data.frame(val_identifiant=levels(tab$car_val_identifiant),

Modified: pkg/stacomir/R/report_mig_interannual.R
===================================================================
--- pkg/stacomir/R/report_mig_interannual.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_mig_interannual.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -64,7 +64,7 @@
 #' This method will check if the data in the t_reportjournalier_bjo table has no missing data,
 #' if missing the program will load missing data. As a second step,
 #' the program will check if the numbers in the table  t_reportjournalier_bjo differ from those in the database,
-#' and propose to re-run the reportmigration (which has a write_database methode to write daily reports) for those years.
+#' and propose to re-run the report_mig (which has a write_database methode to write daily reports) for those years.
 #' @note We expect different results between daily reports from the t_reportjournalier_bjo table and the annual sums
 #' from report_annual for glass eels as those may have been weighted and not only counted. The t_reportjournalier_bjo table used by report_mig_interannual
 #' contains the sum of glass eel numbers converted from weights and those directly counted. The report_annual does not.
@@ -158,7 +158,7 @@
 	        for (y in 1:length(missing_years)){
 		      Y<-missing_years[y]
 		      bM=new("report_mig")
-		      if (!silent) funout(gettextf("Running reportmigration for year %s",Y,domain="R-StacomiR"))
+		      if (!silent) funout(gettextf("Running report_mig for year %s",Y,domain="R-StacomiR"))
 		      bM=choice_c(bM,
 				  dc=dic[i],
 				  taxa=object at taxa@data$tax_nom_latin,
@@ -202,7 +202,7 @@
 		      bM=new("report_mig")
 		      for (Y in differing_years){
 			    # Y=differing_years[1]
-			    funout(gettextf("Running reportmigration to correct data for year %s",Y))
+			    funout(gettextf("Running report_mig to correct data for year %s",Y))
 			    bM=choice_c(bM,
 					dc=dic[i],
 					taxa=object at taxa@data$tax_nom_latin,
@@ -226,7 +226,7 @@
 	        #==================================
 	        
 	        if (!silent){
-		      choice2<-gWidgets::gconfirm(gettextf("Some data differ between t_reportjournalier_bjo table, this means that they have been changed after the last reportmigration was run,  
+		      choice2<-gWidgets::gconfirm(gettextf("Some data differ between t_reportjournalier_bjo table, this means that they have been changed after the last report_mig was run,  
 						  do you want to load them again for calculation ?",domain="R-StacomiR"),
 				  handler=reload_years_with_error)
 	        } else {
@@ -466,7 +466,7 @@
 #' 
 #' @param dat a data frame with columns ("bjo_annee","bjo_jour","bjo_labelquantite","bjo_valeur")
 #' @param annee The year to exclude from the historical series (it will be plotted against the historical series)
-#' @param timesplit "week" "2 week" "month" as provided to seq.POSIXT, default NULL
+#' @param timesplit "week" "2 week" "month" as provided to seq.POSIXt, default NULL
 #' @return a data frame with mean, max, and min calculated for each timesplit
 #' @export
 fun_report_mig_interannual=function(dat,annee=NULL,timesplit=NULL)
@@ -546,7 +546,7 @@
 #' english values within parenthesis are also accepted.
 #' @param silent Stops displaying the messages.
 #' \itemize{
-#' 		\item{plot.type="line": one line per daily reportmigration}
+#' 		\item{plot.type="line": one line per daily report_mig}
 #' 		\item{plot.type="standard": the current year is displayed against a ribbon of historical values"}
 #' 		\item{plot.type="density": creates density plot to compare seasonality, data computed by 15 days period}
 #' 		\item{plot.type="step" : creates step plots to compare seasonality, the year chosen in the interface is the

Modified: pkg/stacomir/R/report_mig_mult.R
===================================================================
--- pkg/stacomir/R/report_mig_mult.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_mig_mult.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -388,7 +388,7 @@
 #' Plots of various type for report_mig_mult
 #' 
 #' \itemize{
-#' 		\item{plot.type="standard"}{calls \code{\link{fungraph}} and \code{\link{fungraph_glasseel}} functions to plot as many "reportmigration"
+#' 		\item{plot.type="standard"}{calls \code{\link{fungraph}} and \code{\link{fungraph_glasseel}} functions to plot as many "report_mig"
 #' 			as needed, the function will test for the existence of data for one dc, one taxa, and one stage}
 #' 		\item{plot.type="step"}{creates Cumulated graphs for report_mig_mult.  Data are summed per day for different dc taxa and stages}
 #' 		\item{plot.type="multiple"}{Method to overlay graphs for report_mig_mult (multiple dc/taxa/stage in the same plot)}
@@ -568,8 +568,8 @@
 		print(p)	
 		assign("p",p,envir=envir_stacomi)
 		assign("grdata",grdata_without_hole,envir_stacomi)
-		if (!silent) funout(gettext("The plot has been assigned to p in envir_stacomi,write p<-get('p',envir_stacomi) to retreive the object"))
-		if (!silent) funout(gettext("The data for the plot have been assigned to envir_stacomi,write grdata<-get('grdata',envir_stacomi) to retreive the object"))
+		if (!silent) funout(gettext("The plot has been assigned to p in envir_stacomi,write p<-get('p',envir_stacomi) to retrieve the object"))
+		if (!silent) funout(gettext("The data for the plot have been assigned to envir_stacomi,write grdata<-get('grdata',envir_stacomi) to retrieve the object"))
 		
 	  }
 #==========================type=3=============================
@@ -598,9 +598,9 @@
 		
 		print(p)	
 		assign("p",p,envir=envir_stacomi)				
-		if (!silent) funout(gettext("The plot has been assigned to p in envir_stacomi,write p<-get('p',envir_stacomi) to retreive the object"))
+		if (!silent) funout(gettext("The plot has been assigned to p in envir_stacomi,write p<-get('p',envir_stacomi) to retrieve the object"))
 		assign("grdata",grdata,envir_stacomi)	
-		if (!silent) funout(gettext("The data for the plot have been assigned to envir_stacomi,write grdata<-get('grdata',envir_stacomi) to retreive the object"))
+		if (!silent) funout(gettext("The data for the plot have been assigned to envir_stacomi,write grdata<-get('grdata',envir_stacomi) to retrieve the object"))
 		
 	  }
 #==========================end / type=3=============================			

Modified: pkg/stacomir/R/report_sample_char.R
===================================================================
--- pkg/stacomir/R/report_sample_char.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_sample_char.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -8,7 +8,7 @@
 #' of the view vue_lot_ope_car
 #' @slot data A data frame
 #' @slot dc An object of class \link{ref_dc-class}: the control devices
-#' @slot taxa An object of class \link{ref_taxa-class}: the speciess
+#' @slot taxa An object of class \link{ref_taxa-class}: the species
 #' @slot stage An object of class \link{ref_stage-class} : the stages of the fish
 #' @slot par An object of class \link{ref_par-class}: the parameters used
 #' @slot horodatedebut An object of class \link{ref_horodate-class}
@@ -60,7 +60,7 @@
 	  requete at and=paste(" AND ope_dic_identifiant in ",vector_to_listsql(object at dc@dc_selectionne),
 		  " AND lot_tax_code in ", vector_to_listsql(object at taxa@data$tax_code),
 		  " AND lot_std_code in ", vector_to_listsql(object at stage@data$std_code),
-		  " AND car_par_code in ", vector_to_listsql(object at par@par_selectionne), sep="")
+		  " AND car_par_code in ", vector_to_listsql(object at par@par_selected), sep="")
 	  requete<-stacomirtools::connect(requete) 
 	  object at data<-requete at query
 	  if (!silent) funout(gettext("Sample characteristics have been loaded from the database\n",domain="R-stacomiR"))
@@ -182,7 +182,7 @@
 		funout(gettext("No information for these samples during the selected period\n",domain="R-stacomiR"), arret=TRUE)
 	  }   
 	  vue_ope_lot=report_sample_char at data # on recupere le data.frame
-	  nom_variable=report_sample_char at par@data$par_nom[report_sample_char at par@data$par_code%in%report_sample_char at par@par_selectionne]
+	  nom_variable=report_sample_char at par@data$par_nom[report_sample_char at par@data$par_code%in%report_sample_char at par@par_selected]
 	  #stopifnot(length(nom_variable)==1)
 	  vue_ope_lot$ope_dic_identifiant=as.factor(vue_ope_lot$ope_dic_identifiant)
 	  vue_ope_lot$dev_code=as.factor(vue_ope_lot$dev_code)
@@ -287,7 +287,7 @@
 		  "dc=c(",stringr::str_c(x at dc@dc_selectionne,collapse=","),"),",
 		  "taxa=c(",stringr::str_c(shQuote(x at taxa@data$tax_nom_latin),collapse=","),"),",
 		  "stage=c(",stringr::str_c(shQuote(x at stage@data$std_code),collapse=","),"),",	
-		  "par=c(",stringr::str_c(shQuote(x at par@par_selectionne),collapse=","),"),",	
+		  "par=c(",stringr::str_c(shQuote(x at par@par_selected),collapse=","),"),",	
 		  "horodatedebut=",shQuote(strftime(x at horodatedebut@horodate,format="%d/%m/%Y %H-%M-%S")),
 		  ",horodatefin=",shQuote(strftime(x at horodatefin@horodate,format="%d/%m/%Y %H-%M-%S")),")")
 	  # removing backslashes

Modified: pkg/stacomir/R/report_sea_age.R
===================================================================
--- pkg/stacomir/R/report_sea_age.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_sea_age.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -86,7 +86,7 @@
 	  requete at and=paste(" AND ope_dic_identifiant in ",vector_to_listsql(object at dc@dc_selectionne),
 		  " AND lot_tax_code in ", vector_to_listsql(object at taxa@data$tax_code),
 		  " AND lot_std_code in ", vector_to_listsql(object at stage@data$std_code),
-		  " AND car_par_code in ", vector_to_listsql(object at par@par_selectionne), sep="")
+		  " AND car_par_code in ", vector_to_listsql(object at par@par_selected), sep="")
 	  requete<-stacomirtools::connect(requete) 
 	  object at data<-requete at query
 	  if (!silent) funout(gettext("Data loaded",domain="R-stacomiR"))
@@ -355,7 +355,7 @@
 #' into the tj_caracteristiquelot_car table in the user's scheme
 #' 
 #' The sea age caracteristic is calculated from the mesured or calculated size of salmon and with a size/age rule
-#' defined by the user . the name of the database is retreived from the odbc link
+#' defined by the user . the name of the database is retrieved from the odbc link
 #' defined in calcmig.csv
 #' @param object an object of class \link{report_sea_age-class}
 #' @param silent : Default FALSE, if TRUE the program should no display messages.
@@ -431,7 +431,7 @@
 		  "dc=c(",stringr::str_c(x at dc@dc_selectionne,collapse=","),"),",
 		  "taxa=c(",stringr::str_c(shQuote(x at taxa@data$tax_nom_latin),collapse=","),"),",
 		  "stage=c(",stringr::str_c(shQuote(x at stage@data$std_code),collapse=","),"),",	
-		  "par=c(",stringr::str_c(shQuote(x at par@par_selectionne),collapse=","),"),",	
+		  "par=c(",stringr::str_c(shQuote(x at par@par_selected),collapse=","),"),",	
 		  "horodatedebut=",shQuote(strftime(x at horodatedebut@horodate,format="%d/%m/%Y %H-%M-%S")),
 		  ",horodatefin=",shQuote(strftime(x at horodatefin@horodate,format="%d/%m/%Y %H-%M-%S")),")")
 	  # removing backslashes

Modified: pkg/stacomir/R/report_silver_eel.R
===================================================================
--- pkg/stacomir/R/report_silver_eel.R	2017-06-20 08:50:12 UTC (rev 401)
+++ pkg/stacomir/R/report_silver_eel.R	2017-06-20 11:03:56 UTC (rev 402)
@@ -21,7 +21,7 @@
 #' dev_libelle (text for destination of fish)
 #' }
 #' @slot dc Object of class \link{ref_dc-class}: the control devices
-#' @slot taxa An object of class \link{ref_taxa-class}: the speciess
+#' @slot taxa An object of class \link{ref_taxa-class}: the species
 #' @slot stage An object of class \link{ref_stage-class} : the stages of the fish
 #' @slot par An object of class \link{ref_par-class}: the parameters used
 #' @slot horodatedebut An object of class \link{ref_horodate-class}
@@ -83,7 +83,7 @@
 	  requete at and=paste(" AND ope_dic_identifiant in ",vector_to_listsql(object at dc@dc_selectionne),
 		  " AND lot_tax_code in ", vector_to_listsql(object at taxa@data$tax_code),
 		  " AND lot_std_code in ", vector_to_listsql(object at stage@data$std_code),
-		  " AND car_par_code in ", vector_to_listsql(object at par@par_selectionne), sep="")
+		  " AND car_par_code in ", vector_to_listsql(object at par@par_selected), sep="")
 	  requete<-stacomirtools::connect(requete) 
 	  object at data<-requete at query
 	  if (!silent) funout(gettext("Data loaded",domain="R-stacomiR"))
@@ -604,7 +604,7 @@
 			strip.border=list(col="black")
 		)
 		lattice::trellis.par.set(my.settings)
-		
+		datdc<-datdc[complete.cases(datdc[,c("Pankhurst","W","BL","ouv","stage")]),]
 		ccc<-lattice::cloud(Pankhurst ~ W * BL|ouv, data = datdc,group=stage,
 			screen = list(x = -90, y = 70), distance = .4, zoom = .6,strip = lattice::strip.custom(par.strip.text=list(col="white")))
 		return(ccc)
@@ -630,12 +630,12 @@
 	  dat<-r_silver at calcdata
 	  # cols are using viridis::inferno(6,alpha=0.9)
 	  
-	  printstat<-function(vec){
+	  printstat<-function(vec,silent){
 		moy<-mean(vec,na.rm=TRUE)
 		sd<- sd(vec,na.rm=TRUE) # sample standard deviation 
 		n<-length(vec[!is.na(vec)])
 		SE = sd/sqrt(n)
-		print(noquote(stringr::str_c("mean=",round(moy,2),",SD=",round(sd,2),",N=",n,",SE=",round(SE,2))))
+		if (!silent) print(noquote(stringr::str_c("mean=",round(moy,2),",SD=",round(sd,2),",N=",n,",SE=",round(SE,2))))
 		return(list("mean"=moy,"SD"=sd,"N"=n,"SE"=SE))
 	  }
 	  result<-list()
@@ -646,27 +646,37 @@
 		dc<-as.character(unique(datdc$ope_dic_identifiant))
 		result[[dc]]<-list()
 		result[[dc]][["ouvrage"]]<-ouvrage
-		print(noquote(stringr::str_c("Statistics for dam : ",ouvrage)))
-		print(noquote("========================"))
-		print(noquote("Stages Durif"))
-		print(table(datdc$stage))
+		if (! silent){
+                  print(noquote(stringr::str_c("Statistics for dam : ",ouvrage)))
+		          print(noquote("========================"))
+		          print(noquote("Stages Durif"))
+		          print(table(datdc$stage))
+        }
 		result[[dc]][["Stages"]]<-table(datdc$stage)
-		print(noquote("-----------------------"))
-		print(noquote("Pankhurst"))
-		print(noquote("-----------------------"))
-		result[[dc]][["Pankhurst"]]<-printstat(datdc$Pankhurst)		
-		print(noquote("-----------------------"))
-		print(noquote('Eye diameter (mm)'))		
-		print(noquote("-----------------------"))
-		result[[dc]][["MD"]]<-printstat(datdc$MD)				
-		print(noquote("-----------------------"))
-		print(noquote('Length (mm)'))	
-		print(noquote("-----------------------"))
-		result[[dc]][["BL"]]<-printstat(datdc$BL)	
-		print(noquote("-----------------------"))
-		print(noquote('Weight (g)'))	
-		print(noquote("-----------------------"))
-		result[[dc]][["W"]]<-printstat(datdc$W)	
+        if (! silent){
+		          print(noquote("-----------------------"))
+		          print(noquote("Pankhurst"))
+		          print(noquote("-----------------------"))
+        }
+		result[[dc]][["Pankhurst"]]<-printstat(datdc$Pankhurst,silent=silent)	
+	    if (! silent){    
+		          print(noquote("-----------------------"))
+		          print(noquote('Eye diameter (mm)'))		
+		          print(noquote("-----------------------"))
+        }
+		result[[dc]][["MD"]]<-printstat(datdc$MD,silent=silent)		
+		if (! silent){
+		          print(noquote("-----------------------"))
+		          print(noquote('Length (mm)'))	
+		          print(noquote("-----------------------"))
+        }
+		result[[dc]][["BL"]]<-printstat(datdc$BL,silent=silent)	
+        if (! silent){
+		          print(noquote("-----------------------"))
+		          print(noquote('Weight (g)'))	
+		          print(noquote("-----------------------"))
+        }
+		result[[dc]][["W"]]<-printstat(datdc$W,silent=silent)	
 	  }
 	  return(result)		
 	})
@@ -684,7 +694,7 @@
 		  "dc=c(",stringr::str_c(x at dc@dc_selectionne,collapse=","),"),",
 		  "taxa=c(",stringr::str_c(shQuote(x at taxa@data$tax_nom_latin),collapse=","),"),",
 		  "stage=c(",stringr::str_c(shQuote(x at stage@data$std_code),collapse=","),"),",	
-		  "par=c(",stringr::str_c(shQuote(x at par@par_selectionne),collapse=","),"),",	
+		  "par=c(",stringr::str_c(shQuote(x at par@par_selected),collapse=","),"),",	
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/stacomir -r 402


More information about the Stacomir-commits mailing list