[Stacomir-commits] r187 - in pkg/stacomir: . R data inst/config
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Sep 1 20:46:49 CEST 2016
Author: briand
Date: 2016-09-01 20:46:49 +0200 (Thu, 01 Sep 2016)
New Revision: 187
Added:
pkg/stacomir/R/BilanAnnuels.r
Removed:
pkg/stacomir/R/BilanAnnuels.R
Modified:
pkg/stacomir/DESCRIPTION
pkg/stacomir/NAMESPACE
pkg/stacomir/R/BilanEspeces.r
pkg/stacomir/R/BilanMigration.r
pkg/stacomir/R/BilanMigrationConditionEnv.r
pkg/stacomir/R/BilanMigrationInterAnnuelle.r
pkg/stacomir/R/Bilan_carlot.r
pkg/stacomir/R/Bilan_stades_pigm.r
pkg/stacomir/R/create_generic.r
pkg/stacomir/R/data.r
pkg/stacomir/R/fungraph.r
pkg/stacomir/R/interface_BilanConditionEnv.r
pkg/stacomir/R/interface_BilanMigrationPar.r
pkg/stacomir/R/interface_Bilan_carlot.r
pkg/stacomir/R/interface_Bilan_taille.r
pkg/stacomir/R/stacomi.r
pkg/stacomir/R/utilitaires.r
pkg/stacomir/data/bM_Arzal.rda
pkg/stacomir/inst/config/generate_data.R
Log:
Modified: pkg/stacomir/DESCRIPTION
===================================================================
--- pkg/stacomir/DESCRIPTION 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/DESCRIPTION 2016-09-01 18:46:49 UTC (rev 187)
@@ -35,6 +35,7 @@
'Refparqual.r'
'Refparquan.r'
'BilanMigrationPar.r'
+ 'BilanAnnuels.r'
'Bilan_carlot.r'
'RefCoe.r'
'Bilan_poids_moyen.r'
@@ -104,4 +105,5 @@
Maintainer: Cedric Briand <cedric.briand00 at gmail.com>
RoxygenNote: 5.0.1
NeedsCompilation: no
-Suggests: testthat
+Suggests:
+ testthat
Modified: pkg/stacomir/NAMESPACE
===================================================================
--- pkg/stacomir/NAMESPACE 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/NAMESPACE 2016-09-01 18:46:49 UTC (rev 187)
@@ -1,6 +1,7 @@
# Generated by roxygen2: do not edit by hand
export(chargecsv)
+export(funBilanMigrationAnnuel)
export(fun_bilanMigrationMult)
export(fun_bilanMigrationMult_Overlaps)
export(fun_char_spe)
Deleted: pkg/stacomir/R/BilanAnnuels.R
===================================================================
--- pkg/stacomir/R/BilanAnnuels.R 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/BilanAnnuels.R 2016-09-01 18:46:49 UTC (rev 187)
@@ -1,2 +0,0 @@
-# see funBilanMigrationInterannuel pour modif
-
Copied: pkg/stacomir/R/BilanAnnuels.r (from rev 185, pkg/stacomir/R/BilanAnnuels.R)
===================================================================
--- pkg/stacomir/R/BilanAnnuels.r (rev 0)
+++ pkg/stacomir/R/BilanAnnuels.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -0,0 +1,2 @@
+# see funBilanMigrationInterannuel pour modif
+
Modified: pkg/stacomir/R/BilanEspeces.r
===================================================================
--- pkg/stacomir/R/BilanEspeces.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/BilanEspeces.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -13,7 +13,7 @@
#' @slot datedebut A \link[base]{-.POSIXt} value
#' @slot datefin A \link[base]{-.POSIXt} value
#' @slot data \code{data.frame}
-#' @slot liste Object of class \code{\link{RefListe}} RefListe referential
+#' @slot liste Object of class \code{\link{RefListe-class}} RefListe referential
#' class choose within a list
#' @include RefDC.r
Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/BilanMigration.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -91,10 +91,10 @@
})
#' command line interface for BilanMigration class
#' @param object An object of class \link{BilanMigration-class}
-#' @param dc A numeric or integer, the code of the dc, coerced to integer,see \link{choice_c-RefDC-method}
+#' @param dc A numeric or integer, the code of the dc, coerced to integer,see \link{choice_c,RefDC-method}
#' @param taxons Either a species name in latin or the SANDRE code for species (ie 2038=Anguilla anguilla),
-#' these should match the ref.tr_taxon_tax referential table in the stacomi database, see \link{choice_c-RefTaxon-method}
-#' @param stades A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database see \link{choice_c-RefStades-method}
+#' these should match the ref.tr_taxon_tax referential table in the stacomi database, see \link{choice_c,RefTaxon-method}
+#' @param stades A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database see \link{choice_c,RefStades-method}
#' @param datedebut The starting date as a character, formats like \code{\%Y-\%m-\%d} or \code{\%d-\%m-\%Y} can be used as input
#' @param datefin The finishing date of the Bilan, for this class this will be used to calculate the number of daily steps.
#' The choice_c method fills in the data slot for RefDC, RefTaxon, RefStades, and RefPasDeTempsJournalier and then
@@ -158,7 +158,7 @@
}
stopifnot(validObject(bilanMigration, test=TRUE))
funout(get("msg",envir=envir_stacomi)$BilanMigration.2)
- return(bilanMigrationMult)
+ return(bilanMigration)
})
@@ -172,7 +172,7 @@
#' @param silent Boolean, if true, information messages are not displays, only warnings and errors
#' @note The class BilanMigration does not handle escapement rates nor
#' 'devenir' i.e. the destination of the fishes.
-#' @return BilanMigration with slots filled by user choice
+#' @return BilanMigration with calcdata slot filled.
#' @export
setMethod("calcule",signature=signature("BilanMigration"),definition=function(object,negative=FALSE,silent=FALSE){
#bilanMigration<-bM_Arzal
@@ -269,13 +269,6 @@
#' @param ... Additional arguments, see \code{plot}, \code{plot.default} and \code{par}
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @export
-
-#' handler hBilanMigrationgraph
-#' calls the fungraph for BilanMigration and allows the saving of daily and monthly counts in the database
-#' @note pb if other than daily value, the time steps have been constrained to daily values for this plot
-#' @param h a handler
-#' @param ... Additional parameters
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
setMethod("plot",signature(x = "BilanMigration", y = "ANY"),definition=function(x, y,plot.type="standard",silent=FALSE,...){
#bilanMigration<-bM_Arzal
bilanMigration<-x
@@ -306,8 +299,8 @@
}
if (any(duplicated(data$No.pas))) stop("duplicated values in No.pas")
data_without_hole<-merge(
- data.frame(No.pas=as.numeric(strftime(bilanMigrationMult at time.sequence,format="%j"))-1,
- debut_pas=bilanMigrationMult at time.sequence),
+ data.frame(No.pas=as.numeric(strftime(bilanMigration at time.sequence,format="%j"))-1,
+ debut_pas=bilanMigration at time.sequence),
data,
by=c("No.pas","debut_pas"),
all.x=TRUE
Modified: pkg/stacomir/R/BilanMigrationConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanMigrationConditionEnv.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/BilanMigrationConditionEnv.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -64,6 +64,14 @@
# calcule(bilanMigrationConditionEnv)
}
#object<-bilanMigrationConditionEnv
+#' Performs the calculations of environment conditions attached to a migration monitoring station
+#'
+
+
+#' @param object An object of class \code{\link{BilanMigrationEnv-class}}
+#' @param ... additional parameters
+#' @return \code{\link{BilanMigrationEnv-class}}
+#' @export
setMethod("calcule",signature=signature("BilanMigrationConditionEnv"),definition=function(object,...){
# le chargement de bilanMigration utilise la methode calcule de BilanMigration
# qui charge les objects et en plus fait un calcul dessus, e la fin cette methode assigne les objects
Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -13,8 +13,8 @@
#' @slot data Object of class \code{"data.frame"} data for bilan lot
#' @slot taxons An object of class \code{\link{RefTaxon-class}}
#' @slot stades An object of class \code{\link{RefStades-class}}
-#' @slot anneedebut Object of class \code{\link{RefAnnee-class}}. refAnnee allows to choose year of beginning
-#' @slot anneefin Object of class \code{\link{RefAnnee-class}}
+#' @slot anneeDebut Object of class \code{\link{RefAnnee-class}}. refAnnee allows to choose year of beginning
+#' @slot anneeFin Object of class \code{\link{RefAnnee-class}}
#' refAnnee allows to choose last year of the Bilan
#'
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
Modified: pkg/stacomir/R/Bilan_carlot.r
===================================================================
--- pkg/stacomir/R/Bilan_carlot.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/Bilan_carlot.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -77,9 +77,9 @@
#'
#' this method verifies that boxes have been clicked in the user interface and gets the objects pasted in
#' envir_stacomi
-#' @param object An object of class \code{\link{Bilan_carlot}}
+#' @param object An object of class \link{Bilan_carlot-class}
#' @param h a handler
-#' @return Bilan_carlot with slots filled with user choice
+#' @return An object of class \link{Bilan_carlot-class} with slots filled with user choice
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @export
#' @return An object of the class
Modified: pkg/stacomir/R/Bilan_stades_pigm.r
===================================================================
--- pkg/stacomir/R/Bilan_stades_pigm.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/Bilan_stades_pigm.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -861,10 +861,10 @@
choice(bilan_stades_pigm at lmax)
choice(bilan_stades_pigm at options)
# on assigne directement (sans forcement changer les options...)
- assign("refCheckBox",bilan_stades_pigm at options,.globalEnv)
+ assign("refCheckBox",bilan_stades_pigm at options,.GlobalEnv)
choice(bilan_stades_pigm at salinite)
# on assigne directement (sans forcement changer les options...)
- assign("refTextBox",bilan_stades_pigm at salinite,.globalEnv)
+ assign("refTextBox",bilan_stades_pigm at salinite,.GlobalEnv)
choice(bilan_stades_pigm at stationMesure,title="choice de la temperature")
choice(bilan_stades_pigm at horodate,label=get("msg",envir=envir_stacomi)$interface_Bilan_lot.3,
nomassign="bilan_stades_pigm_date_debut",
Modified: pkg/stacomir/R/create_generic.r
===================================================================
--- pkg/stacomir/R/create_generic.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/create_generic.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -4,19 +4,67 @@
#liste_chemins=chargecsv()
#baseODBC=liste_chemins[["baseODBC"]]
#listes de connection e la base de donnee (programmation S4)
+
+#' Generic method for choice (using the gwidget graphical interface)
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("choice",def=function(object,...) standardGeneric("choice"))
+#' Generic method for multiple choice (using the gwidget graphical interface)
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("choicemult",def=function(object,...) standardGeneric("choicemult"))
-# load method to work outside the graphical interface
+#' Generic method for manual choice
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("choice_c",def=function(object,...) standardGeneric("choice_c"))
+#' Generic method to load referentials
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("charge",def=function(object,...) standardGeneric("charge"))
+#' Generic method to load referentials, with filters from the parent object in the database
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("charge_avec_filtre",def=function(object,...) standardGeneric("charge_avec_filtre"))
#setGeneric("connect",def=function(object,...) standardGeneric("connect")) # package stacomirtools
+#' Generic method for plot
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("plot",def=function(x,y,...) standardGeneric("plot"))
+#' Generic method to load additional data
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("charge_complement",def=function(object,...) standardGeneric("charge_complement"))
+#' Generic method for calculations
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("calcule",def=function(object,...) standardGeneric("calcule"))
+#' Generic method to delete entires from the database
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("supprime",def=function(object,...) standardGeneric("supprime"))
+#' Generic method getvalue
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("getvalue",def=function(object,...) standardGeneric("getvalue"))
+#' Generic method getvalue
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("out",def=function(object,...) standardGeneric("out"))
+#' Generic method to create messages
+#' @param object Object
+#' @param ... Additional parms
+#' @author cedric.briand
setGeneric("createmessage",def=function(object,...) standardGeneric("createmessage"))
# nouvel environnement
Modified: pkg/stacomir/R/data.r
===================================================================
--- pkg/stacomir/R/data.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/data.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -52,13 +52,13 @@
#' This data corresponds to the data collected at the vertical slot fishway
#' in 2015, video recording of the thin lipped mullet Liza ramada migration
#'
-#' @format An object of class bilanMigration with slots:
+#' @format An object of class bilanMigration with 8 slots:
#' \describe{
-#' \item{dc}{the \code{RefDC} object filled with data}
-#' \item{taxons}{the \code{RefTaxon} object filled in with data corresponding to dc}
-#' \item{stades}{the \code{RefStades} object filled in with data corresponding to dc, and taxon}
+#' \item{dc}{the \code{RefDC} object with 4 slots filled with data corresponding to the iav postgres schema}
+#' \item{taxons}{the \code{RefTaxon} the taxa selected}
+#' \item{stades}{the \code{RefStades} the stage selected}
#' \item{pasDeTemps}{the \code{PasDeTempsJournalier} calculated for all 2015}
-#' \item{data}{ A dataframe with 400 rows and 11 variables
+#' \item{data}{ A dataframe with 10304 rows and 11 variables
#' \describe{
#' \item{ope_identifiant}{operation id}
#' \item{lot_identifiant}{sample id}
@@ -72,8 +72,8 @@
#' \item{lot_methode_obtention}{method of data collection, measured, calculated...}
#' }
#' }
-#' \item{coef_conversion}{A data frame with 364 observations with daily coefficients to convert from weight to numbers}
-#' \item{time.sequence}{A time sequence generated for the bilan, used internally by the object}
+#' \item{coef_conversion}{A data frame with 0 observations : no quantity are reported for video recording of mullets, only numbers}
+#' \item{time.sequence}{A time sequence generated for the bilan, used internally}
#' }
#' @keywords data
-"bMM_Arzal"
\ No newline at end of file
+"bM_Arzal"
\ No newline at end of file
Modified: pkg/stacomir/R/fungraph.r
===================================================================
--- pkg/stacomir/R/fungraph.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/fungraph.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -3,9 +3,9 @@
#' This graph is for species other than glass eel
#'
#'
-#' @usage fungraph(bilanMigration, tableau, time.sequence, taxon, stade, dc,...)
+#' @usage fungraph(bilanMigration, tableau, time.sequence, taxon, stade, dc=NULL,silent,...)
#' @param bilanMigration An object of class \code{\linkS4class{BilanMigration}}
-#' @param table=tableau A data frame with the with the following columns : No.pas,debut_pas,fin_pas,
+#' @param tableau A data frame with the with the following columns : No.pas,debut_pas,fin_pas,
#' ope_dic_identifiant,lot_tax_code,lot_std_code,type_de_quantite,MESURE,CALCULE,
#' EXPERT,PONCTUEL,Effectif_total,taux_d_echappement,coe_valeur_coefficient
#' @note this function is intended to be called from the plot method in BilanMigrationMult and BilanMigration
Modified: pkg/stacomir/R/interface_BilanConditionEnv.r
===================================================================
--- pkg/stacomir/R/interface_BilanConditionEnv.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/interface_BilanConditionEnv.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -30,7 +30,7 @@
ggroupboutonsbas = gWidgets::ggroup(horizontal=FALSE)
gWidgets::add(ggroupboutons,ggroupboutonsbas)
- assign("ggroupboutonsbas",ggroupboutonsbas, envr=.GlobalEnv)
+ assign("ggroupboutonsbas",ggroupboutonsbas, envir=.GlobalEnv)
toolbarlist = list(
#Calc=gWidgets::gaction(handler=hbilanConditionEnvcalc , action=bilanConditionEnv,icon = "new",label="calcul",tooltip="calcul des conditions environnementales entre deux dates"),
Modified: pkg/stacomir/R/interface_BilanMigrationPar.r
===================================================================
--- pkg/stacomir/R/interface_BilanMigrationPar.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/interface_BilanMigrationPar.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -33,7 +33,7 @@
ggroupboutonsbas = gWidgets::ggroup(horizontal=FALSE)
gWidgets::add(ggroupboutons,ggroupboutonsbas)
- assign("ggroupboutonsbas",ggroupboutonsbas, envr=.GlobalEnv)
+ assign("ggroupboutonsbas",ggroupboutonsbas, envir=.GlobalEnv)
toolbarlist = list(
Calc=gWidgets::gaction(handler = hbilanMigrationParcalc,icon = "new",label="calcul",action=bilanMigrationPar,tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigrationPar.3),
Graph=gWidgets::gaction(handler = hbilanMigrationPargraph,icon = "graph",label="graph",tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigrationPar.4),
Modified: pkg/stacomir/R/interface_Bilan_carlot.r
===================================================================
--- pkg/stacomir/R/interface_Bilan_carlot.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/interface_Bilan_carlot.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -72,7 +72,7 @@
ggroupboutonsbas = gWidgets::ggroup(horizontal=FALSE)
gWidgets::add(ggroupboutons,ggroupboutonsbas)
gWidgets::add(ggroupboutonsbas, gtoolbar(toolbarlist))
- assign("ggroupboutonsbas",ggroupboutonsbas, envr=.GlobalEnv)
+ assign("ggroupboutonsbas",ggroupboutonsbas, envir=.GlobalEnv)
gWidgets::addSpring(group)
#graphes=ggraphics(width=600,height=400)
Modified: pkg/stacomir/R/interface_Bilan_taille.r
===================================================================
--- pkg/stacomir/R/interface_Bilan_taille.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/interface_Bilan_taille.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -1,6 +1,6 @@
# Nom fichier : interface_Bilan_taille.R (interface)
-# see interface_BilanLot for doc
+# see interface_Bilancarlot for doc
interface_BilanTaille = function()
{
bilan_taille=new("Bilan_taille")
Modified: pkg/stacomir/R/stacomi.r
===================================================================
--- pkg/stacomir/R/stacomi.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/stacomi.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -57,7 +57,7 @@
#' handler function used by the main interface
hBilan_carlot=function(h,...){
funout(get("msg",envir_stacomi)$interface_graphique.10,wash=TRUE)
- eval(interface_BilanLot(),envir = .GlobalEnv)
+ eval(interface_Bilan_carlot(),envir = .GlobalEnv)
}
#' handler function used by the main interface
hTail=function(h,...){
@@ -437,7 +437,7 @@
gWidgets::add(ggrouptotal1,ggroupboutons,expand=FALSE)
}
-# Variables used in aes arguments generate a note as being assigned to .globalEnv, either use aes_string,
+# Variables used in aes arguments generate a note as being assigned to .GlobalEnv, either use aes_string,
# or listing them below removes the warning in Rcheck. Discussion in stackoverflow about this, hadley wickham
# considering this a hideous hack..
utils::globalVariables(c("quinzaine", "mois","val_quant","time.sequence","Effectifs",
Modified: pkg/stacomir/R/utilitaires.r
===================================================================
--- pkg/stacomir/R/utilitaires.r 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/R/utilitaires.r 2016-09-01 18:46:49 UTC (rev 187)
@@ -204,7 +204,7 @@
#' @param width Width of the progress bar
#' @param height Height of the progress bar
#' @param pulse Do you want the widget to pulse
-#' @return nothing but progress_bar and dialog gwidgets are assigned to .globalEnv
+#' @return nothing but progress_bar and dialog gwidgets are assigned to .GlobalEnv
#'
#' @author cedric.briand
#' @examples
Modified: pkg/stacomir/data/bM_Arzal.rda
===================================================================
(Binary files differ)
Modified: pkg/stacomir/inst/config/generate_data.R
===================================================================
--- pkg/stacomir/inst/config/generate_data.R 2016-09-01 18:46:27 UTC (rev 186)
+++ pkg/stacomir/inst/config/generate_data.R 2016-09-01 18:46:49 UTC (rev 187)
@@ -35,7 +35,7 @@
#################################
-# generates dataset for BilanMigrationMult
+# generates dataset for BilanMigration
# from the vertical slot fishway located at the estuary of the Vilaine (Brittany)
# Taxa Liza Ramada (Thinlip grey mullet) in 2015
##################################
More information about the Stacomir-commits
mailing list