[Stacomir-commits] r395 - in pkg/stacomir: R inst/examples man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sun Jun 11 22:35:32 CEST 2017
Author: briand
Date: 2017-06-11 22:35:32 +0200 (Sun, 11 Jun 2017)
New Revision: 395
Modified:
pkg/stacomir/R/BilanAnnuels.r
pkg/stacomir/R/BilanArgentee.r
pkg/stacomir/R/BilanConditionEnv.r
pkg/stacomir/R/BilanEspeces.r
pkg/stacomir/R/BilanFonctionnementDF.r
pkg/stacomir/R/BilanMigration.r
pkg/stacomir/R/BilanMigrationCar.r
pkg/stacomir/R/BilanMigrationInterAnnuelle.r
pkg/stacomir/R/data.r
pkg/stacomir/inst/examples/bilanFonctionnementDC_example.R
pkg/stacomir/inst/examples/bilanMigrationInterannuelle_example.R
pkg/stacomir/inst/examples/bilanMigrationMult_Arzal.R
pkg/stacomir/man/BilanAnnuels-class.Rd
pkg/stacomir/man/BilanArgentee-class.Rd
pkg/stacomir/man/BilanConditionEnv-class.Rd
pkg/stacomir/man/BilanEspeces-class.Rd
pkg/stacomir/man/BilanFonctionnementDC-class.Rd
pkg/stacomir/man/BilanFonctionnementDF-class.Rd
pkg/stacomir/man/BilanMigration-class.Rd
pkg/stacomir/man/BilanMigrationCar-class.Rd
pkg/stacomir/man/BilanMigrationInterAnnuelle-class.Rd
pkg/stacomir/man/BilanMigrationMult-class.Rd
pkg/stacomir/man/bfDC.Rd
pkg/stacomir/man/bilAM.Rd
pkg/stacomir/man/bilanFonctionnementDC.Rd
pkg/stacomir/man/bilanFonctionnementDC_bM.Rd
pkg/stacomir/man/bilanFonctionnementDF.Rd
pkg/stacomir/man/bilanFonctionnementDF_bM.Rd
pkg/stacomir/man/charge-BilanFonctionnementDF-method.Rd
pkg/stacomir/man/stacomiR-package.Rd
Log:
documentation
Modified: pkg/stacomir/R/BilanAnnuels.r
===================================================================
--- pkg/stacomir/R/BilanAnnuels.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanAnnuels.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,4 +1,6 @@
#' Class "BilanAnnuels"
+#'
+#' This class displays annual migration counts, for several counting device, taxa or stages.
#' @include RefDC.r
#' @include RefTaxon.r
#' @include RefStades.r
Modified: pkg/stacomir/R/BilanArgentee.r
===================================================================
--- pkg/stacomir/R/BilanArgentee.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanArgentee.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,6 +1,8 @@
#' Class "BilanArgentee"
#'
-#' the BilanArgentee class is used to calculate various statistics about the silver eel run
+#' the BilanArgentee class is used to calculate various statistics about the silver eel run. It comprises calculation
+#' of various maturation index such as Durif's stages and Pankhurst eye index. The objective is to provide standardized
+#' output to the stations monitorin the silver eel run.
#' @include create_generic.r
#' @include RefDC.r
#' @include RefTaxon.r
@@ -19,11 +21,11 @@
#' dev_libelle (text for destination of fish)
#' }
#' @slot dc Object of class \link{RefDC-class}: the control devices
-#' @slot taxons Object of class \link{RefTaxon-class}: the speciess
-#' @slot stades Object of class \link{RefStades-class} : the stages of the fish
-#' @slot par Object of class \link{Refpar-class}: the parameters used
-#' @slot horodatedebut An object of class \code{RefHorodate-class}
-#' @slot horodatefin An object of class \code{RefHorodate-class}
+#' @slot taxons An object of class \link{RefTaxon-class}: the speciess
+#' @slot stades An object of class \link{RefStades-class} : the stages of the fish
+#' @slot par An object of class \link{Refpar-class}: the parameters used
+#' @slot horodatedebut An object of class \link{RefHorodate-class}
+#' @slot horodatefin An object of class \link{RefHorodate-class}
#' @section Objects from the Class: Objects can be created by calls of the form
#' \code{new("BilanArgentee", ...)}
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
Modified: pkg/stacomir/R/BilanConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanConditionEnv.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanConditionEnv.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,8 +1,8 @@
#' class BilanConditionEnv simple output of one or several environmental
#' conditions...
#'
-#' Annual overview of environmental conditions. Enables to draw some plot. Mostly used to build
-#' joined graphs for BilanMigration in class BilanMigrationConditionEnv
+#' Annual overview of environmental conditions. This class enables to draw some plot, but will mostly used to build
+#' joined graphs crossing the information from \link{BilanMigrationMult-class} and \link{BilanMigrationConditionEnv-class}
#'
#' @include RefHorodate.r
#' @include RefStationMesure.r
Modified: pkg/stacomir/R/BilanEspeces.r
===================================================================
--- pkg/stacomir/R/BilanEspeces.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanEspeces.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,8 +1,8 @@
-#' Class "BilanEspeces" simple migration / number report
+#' Counts of number per taxa/stages
#'
#' This class is used to make the assessment of all species, and their number. It is intended
#' as a simple way to check what fishes are present (taxa + development stage). Unlike the BilanAnnuels,
-#' it is not restricted on chosen taxa or stages but gives counts for all species present. The taxa is reported unless
+#' it is not restricted to chosen taxa or stages but gives counts for all species present. The taxa is reported unless
#' a taxa has several case, in which case the different stages for the taxa will be reported
#' Using the split arguments
#' the calc method of the class will count numbers, subsamples are not accounted for in the Overview.
@@ -18,18 +18,8 @@
#' @include RefDC.r
#' @include RefListe.r
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Classes
-#' \code{\linkS4class{Bilan_carlot}},
-#' \code{\linkS4class{Bilan_poids_moyen}},
-#' \code{\linkS4class{BilanConditionEnv}}, \code{\linkS4class{BilanEspeces}},
-#' \code{\linkS4class{BilanFonctionnementDC}},
-#' \code{\linkS4class{BilanFonctionnementDF}},
-#' \code{\linkS4class{BilanMigration}},
-#' \code{\linkS4class{BilanMigrationMultConditionEnv}},
-#' \code{\linkS4class{BilanMigrationInterAnnuelle}},
-#' \code{\linkS4class{BilanMigrationCar}}
#' @family Bilan Objects
-#' @aliases bilanEspeces
+#' @aliases bilanEspeces BilanEspeces
#' @keywords classes
#' @export
setClass(Class="BilanEspeces",
Modified: pkg/stacomir/R/BilanFonctionnementDF.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDF.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanFonctionnementDF.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,8 +1,13 @@
-#' Class "BilanFonctionnementDF" Report fishway work
+#' Report on fishway operation
#'
-#' The DF (Dispositif de Franchissement) is a fishway. It may be automated and
-#' be operated only during certain periods. This report allows to see the detail of its work.
-#' In the database four types of operation are set, "1"=normal operation,
+#' Fishways (DF) are of various nature, from very simple eel ladders fed by water discharged from the river,
+#' 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.
+#' 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,
#' "2"=Device stopped in nomral operation (ie lift ascending, high tide...),
#' "3"="Stopped for maintenance or other problem",
#' "4"="Works but not fully operational, ie flow problem, flood, clogged with debris...",
@@ -74,14 +79,6 @@
#'
#' used by the graphical interface to retrieve the objects of Referential classes
#' assigned to envir_stacomi
-#' @note Fishways (DF) are of various nature, from very simple eel ladders fed by water discharged from the river,
-#' 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.
-#' 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.
#' @param object An object of class \link{BilanFonctionnementDF-class}
#' @param silent Keeps program silent
#' @return An object of class \link{BilanFonctionnementDF-class}
Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanMigration.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -1,5 +1,9 @@
#' Migration report for one DC, one species and one stage
#'
+#' This class performs a migration summary. A migration monitoring operation can correspond to a single
+#' horodate (in the case of some video monitoring operation) or comprise a period which does not necessarily
+#' span a full day. The daily migration is calculated by splitting the operation between days, and the migration is either
+#' grouped or split according to the lenth of the different time spans.#'
#' @include RefTaxon.r
#' @include RefStades.r
#' @include PasDeTempsJournalier.r
@@ -13,8 +17,7 @@
#' @slot coef_conversion A data.frame of daily weight to number conversion coefficients, filled in by the connect
#' method if any weight are found in the data slot.
#' @slot time.sequence Object of class \code{POSIXct} : a time sequence of days generated by the calcule method
-#' @note Method \code{plot(...,type="standard")} also calls a function that will write to the database if
-#' a connection to the database is expected.
+#' @note In practise, the BilanMigration class uses methods (calcule, connect...) from the more elaborate \link{BilanMigrationMult-class}
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @family Bilan Objects
#' @keywords classes
Modified: pkg/stacomir/R/BilanMigrationCar.r
===================================================================
--- pkg/stacomir/R/BilanMigrationCar.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanMigrationCar.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -6,7 +6,7 @@
#' of fish according to gender, number of fish per age class. This class does not split migration evenly over
#' time period. So, unlike calculations made in class BilanMigration and BilanMigrationMult
#' the whole time span of the migration operation is not considered, only the date of beginning of
-#' the operation is used to perform calculation.
+#' the operation is used to perform calculations.
#'
#' @include Refparquan.r
#' @include Refparqual.r
@@ -19,7 +19,7 @@
#' using interface_BilanMigrationCar function.
#' @slot calcdata A "list" of calculated data, filled in by the calcule method
#' @slot data A \code{data.frame} inherited from \link{Bilan_carlot-class}
-#' @slot dc an object of class \link{RefDC-class} inherited from \link{Bilan_carlot-class}
+#' @slot dc An object of class \link{RefDC-class} inherited from \link{Bilan_carlot-class}
#' @slot taxons An object of class \link{RefTaxon-class} inherited from \link{Bilan_carlot-class}
#' @slot stades An object of class \link{RefStades-class} inherited from \link{Bilan_carlot-class}
#' @slot horodatedebut An object of class \link{RefHorodate-class} inherited from \link{Bilan_carlot-class}
@@ -30,7 +30,6 @@
#' @slot parqual An object of class \link{Refparqual-class}, quanlitative parameter
#' @family Bilan Objects
#' @aliases BilanMigrationCar bilanMigrationCar
-#' @note program : default two parameter choice, checking box "none" will allow the program to ignore the parameter
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @concept Bilan Object
#' @keywords classes
Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -2,19 +2,24 @@
#'
#' When daily bilan are written in the t_bilanjournalier_bjo table by the
#' \link{BilanMigration-class} they can be used by this class to display
-#' interannual comparisons of migration. Different charts are produced with different
-#' period grouping. See \link{write_database,BilanMigration-method} for details about the writing to the
-#' t_bilanjournalier_bjo table.
+#' interannual comparisons of migration.
+#' When running its connect method, this class will run the \link{BilanMigration-class}
+#' for each year where data are missing, or
+#' where the annual sum in the t_bilanjournalier_bjo table differs from the counts
+#' generated by the \link{BilanAnnuels-class} : rows have been changed in the database.
+#' Different charts are produced with different
+#' period grouping. See \link{write_database,BilanMigration-method} for details about how
+#' this method inserts data in the t_bilanjournalier_bjo table.
#'
#' @include RefAnnee.r
-#' @slot dc Object of class \code{\link{RefDC-class}}, the counting device
-#' @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 dc An object of class \link{RefDC-class}, the counting device
+#' @slot data A \code{data.frame} data loaded from the daily migration table t_bilanmigrationjournalier_bjo
+#' @slot taxons An object of class \link{RefTaxon-class}
+#' @slot stades An object of class \link{RefStades-class}
+#' @slot anneeDebut An object of class \link{RefAnnee-class}. refAnnee allows to choose year of beginning
+#' @slot anneeFin An object of class \link{RefAnnee-class}
#' refAnnee allows to choose last year of the Bilan
-#' @slot calcdata A "list" of calculated data, filled in by the calcule method
+#' @slot calcdata A \code{list} of calculated data, filled in by the calcule method
#'
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @family Bilan Objects
Modified: pkg/stacomir/R/data.r
===================================================================
--- pkg/stacomir/R/data.r 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/R/data.r 2017-06-11 20:35:32 UTC (rev 395)
@@ -75,7 +75,8 @@
#' Fishway operation at the Arzal Dam (Vilaine France) (3 Fishways in 2011)
#'
#' This dataset corresponds to the data collected at three different fishways
-#' it is loaded along with \link{bMM_Arzal}
+#' it is loaded along with \link{bMM_Arzal} and used in demonstration for the
+#' \link{BilanMigrationMult-class}
#' @format An object of class BilanFonctionnementDF \link{BilanFonctionnementDF-class}
#' @keywords data
"bilanFonctionnementDF"
@@ -83,10 +84,38 @@
#' Counting device operation for three different counting device in Arzal (Vilaine, France)
#'
-#' This dataset corresponds to the data collected at three different control devices.
+#' This dataset corresponds to 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}
-#' @format An object of class BilanFonctionnementDC
+#' it is loaded along with \link{bMM_Arzal} and used in demonstration for the
+#' \link{BilanMigrationMult-class}
+#' @format An object of class BilanFonctionnementDC with 4 slots
+#' \describe{
+#' \item{data}{ A dataframe with 25 rows and 7 variables
+#' \describe{
+#' \item{per_dis_identifiant}{the df or dc unique id}
+#' \item{per_date_debut}{the starting date of the counting device operation \code{POSIXct}}
+#' \item{per_date_fin}{the ending date of the counting device operation \code{POSIXct}}
+#' \item{per_commentaires}{comments on the counting device operation}
+#' \item{per_etat_fonctionnement}{Boolean, is the counting device working ?}
+#' \item{lot_std_code}{stage id}
+#' \item{per_tar_code}{The type of operation for the DC, 1 normal operation, 2 device stopped in normal
+#' operation (the stop is considered as normal, e.g. you don't monitor video if a cage has been placed to trap fishes),
+#' 3 stopped for maintenance or other problem, 4 the DC is working but not well (escapement in a tank, high turbidity preventing
+#' video counting...), 5 unknown operation.}
+#' \item{libelle}{The label for the type or operation}
+#' }
+#' }
+#' \item{dc}{the \code{RefDC} the DC with 4 slots
+#' \describe{
+#' \item{dc_selectionne}{the selected device}
+#' \item{ouvrage}{the dam}
+#' \item{station}{the monitoring station, a section of river}
+#' \item{data}{A dataset of all dc present in the database with 10 observations}
+#' }
+#' }
+#' \item{horodatedebut}{the beginning date, a \link{RefHorodate-class}}
+#' \item{horodatefin}{the ending date, a \link{RefHorodate-class}}
+#' }
#' @keywords data
"bilanFonctionnementDC"
@@ -143,7 +172,7 @@
#'
#' @format An object of class BilanFonctionnementDC with 4 slots:
#' \describe{
-#' #' \item{data}{ A dataframe with 544 obs. of 7 variables
+#' \item{data}{ A dataframe with 544 obs. of 7 variables
#' \describe{
#' \item{per_dis_identifiant}{The number of the DC}
#' \item{per_date_debut}{Starting time a POSIXct}
@@ -162,25 +191,27 @@
#' }
#' \item{df}{the \code{RefDC} object with 3 slots filled with data corresponding to the iav postgres schema}
#' \item{horodatedebut}{the \code{RefHorodate} with horodate set for starting date}
-#' \item{horodatefin}{the \code{RefHorodate} with horodate set for ending date} #'
+#' \item{horodatefin}{the \code{RefHorodate} with horodate set for ending date}
#' }
#' @keywords data
"bfDC"
-#' An object of class \link{BilanFonctionnementDF-class} with data loaded
+#' Fishway operation for the vertical slot fishway (Arzal dam, Vilaine, France).
#'
-#' This dataset corresponds to the data collected at three different fishways
-#' it is loaded along with \link{bM_Arzal}
-#' @format An object of class BilanFonctionnementDF
+#' This dataset corresponds to the data collected at in the vertical slot fishway
+#' it is loaded along with \link{bM_Arzal} and used to demonstrate the \link{BilanMigration-class}
+#' when the database is not installed.
+#' @format An object of class \link{BilanFonctionnementDF-class}
#' @keywords data
"bilanFonctionnementDF_bM"
-#' An object of class \link{BilanFonctionnementDC-class} with data loaded
+#' Counting device operation for the video recording (Arzal dam, Vilaine, France).
#'
-#' This dataset corresponds to the data collected at three different control devices
-#' it is loaded along with \link{bM_Arzal}
-#' @format An object of class BilanFonctionnementDC
+#' This dataset corresponds to the data collected in the vertical slot fishway for the video
+#' recording operation. It is loaded along with \link{bM_Arzal} to
+#' demonstrate the use of the \link{BilanMigration-class} when the database is not loaded
+#' @format An object of class \link{BilanFonctionnementDC-class}
#' @keywords data
"bilanFonctionnementDC_bM"
@@ -221,7 +252,7 @@
#' @keywords data
"bilA"
-#' Annual migration of salmon by migradour
+#' Annual migration of salmon in the Adour and tributaries
#'
#' The dataset corresponds to the fishways DC=33:40 of the Adour for adult migrant salmons
#' from 1996 to 2005 (annual counts). It has been kinly provided as an example set by the Migradour
Modified: pkg/stacomir/inst/examples/bilanFonctionnementDC_example.R
===================================================================
--- pkg/stacomir/inst/examples/bilanFonctionnementDC_example.R 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/inst/examples/bilanFonctionnementDC_example.R 2017-06-11 20:35:32 UTC (rev 395)
@@ -2,7 +2,10 @@
stacomi(gr_interface=FALSE,
login_window=FALSE,
database_expected=FALSE)
-## An example that will work with the database installed only
+###########################################################
+## An example that will work only if the database is present
+## and the program installed and comprises the schema iav
+###########################################################"
\dontrun{
bfDC=new("BilanFonctionnementDC")
bfDC<-choice_c(bfDC,
@@ -11,20 +14,20 @@
horodatefin="2015-12-31",
silent=TRUE)
Sys.setenv(TZ='GMT')
- # the times at Arzal are recorded continuously
- # they are converted to date when a time appears while the hour is changing
- # hence the following
+ # This dataset formating is GMT. If this option is not set
+ # the dataset is tranformed from timestamp to date
bfDC<-charge(bfDC)
bfDC<-connect(bfDC)
-
-
+ # this dataset has been loaded by the previous lines
+###########################################################
+# Without connexion to the database (use dataset bfDC)
+##########################################################
data("bfDC")
plot(bfDC,plot.type="1")
plot(bfDC,plot.type="2")
plot(bfDC,plot.type="3",main="trial title")
plot(bfDC,plot.type="4",main="trial title")
# the following will write in the datawd folder
-
summary(bfDC)
}
##
Modified: pkg/stacomir/inst/examples/bilanMigrationInterannuelle_example.R
===================================================================
--- pkg/stacomir/inst/examples/bilanMigrationInterannuelle_example.R 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/inst/examples/bilanMigrationInterannuelle_example.R 2017-06-11 20:35:32 UTC (rev 395)
@@ -3,8 +3,9 @@
stacomi(gr_interface=FALSE,
login_window=FALSE,
database_expected=FALSE)
-# the following script will load the Arzal dataset if connected to iav schema
+###### If you have connection to the database with the pmp scheme ############
\dontrun{
+
# overriding user schema to point to Parc Marais Poitevin
# (longest historical dataset available
# in France for eel ...) this suppose you have access to the pmp schema...
@@ -26,17 +27,19 @@
bmi<-charge(bmi,silent=TRUE)
bmi<-connect(bmi,silent=TRUE)
}
+#############otherwise use this ######################
# load the dataset generated by previous lines
data("bmi")
+#######################################################
# the first plot is of little interest, it allows to see what data
# are available... simple lines
# For irregular operations like those reported at the enfrenaux eel ladder....
plot(bmi,plot.type="line",silent=TRUE)
-# a plot to show the seasonality, Here it has also to do with the monitoring period
-# the y unit has little sense in this graph
+# a plot to show the seasonality, this graph may be misleading if the
+# migration is not monitored all year round. Note the y unit is not very informative
+# you need to have the viridis package loaded to run this example
plot(bmi,plot.type="density",silent=TRUE)
-#install.packages("viridis")
\dontrun{
if (requireNamespace("ggplot2", quietly = TRUE)&
requireNamespace("viridis", quietly = TRUE)){
@@ -45,7 +48,9 @@
ggplot2::scale_fill_manual(values=viridis::viridis(22))+
ggplot2::ggtitle("Saisonnalite de la migration aux Enfrenaux")
}
+#############################################
# the standard plot is showing daily values
+###########################################
plot(bmi,plot.type="standard",silent=TRUE)
# Manual edition of the graph produced
if (requireNamespace("ggplot2", quietly = TRUE)){
@@ -59,12 +64,14 @@
ggplot2::ylab("Nombre d'anguilles")
print(g1)
}
-
-# Another graph from scratch
+#########################################################
+# Another graph to show a "manual" processing of the data
+# and their extraction from the data slot
+#########################################################
if (requireNamespace("ggplot2", quietly = TRUE)&
requireNamespace("viridis", quietly = TRUE)){
-dat<-funtraitementdate(bmi at data, # tableau de donnees a importer
- "bjo_jour", # nom de la colonne
+dat<-funtraitementdate(bmi at data, # data to import
+ "bjo_jour", # name of the column where dates are found
annee=FALSE,
mois=TRUE,
semaine =TRUE,
@@ -83,13 +90,25 @@
ggplot2::ggtitle("Historical trend at Les Enfrenaux Eel trap")
}
+###############################################
+# barchart with different splitting periods
+# the migration is displayed against seasonal data
+# extacted from all other years loaded in the bilan
+################################################
# available arguments for timesplit are "quinzaine" and "mois" and "semaine"
-# with the silent=TRUE argument, it's always the latest year that is selected
+# with the silent=TRUE argument, it's always the latest year that is selected,
+# otherwise the user is prompted with a choice, to select the year he wants
+# to compare will all others...
plot(bmi,plot.type="barchart",timesplit="quinzaine",silent=TRUE)
# Comparison with historical values. Each year and 2 weeks values
# is a point on the graph...
plot(bmi,plot.type="pointrange",timesplit="mois",silent=TRUE)
-
+###############################################
+# Step plot
+# different years shown in the graph
+# the current year (or the selected year if silent=FALSE)
+# is displayed with a dotted line
+################################################
plot(bmi,plot.type="step",silent=TRUE)
if (requireNamespace("ggplot2", quietly = TRUE)&
requireNamespace("viridis", quietly = TRUE)){
@@ -99,30 +118,37 @@
at les Enfrenaux eel trap")
}
-
+###############################################
+# Plots for seasonality of the salmon migration
+# using a Loire river dataset (Vichy fishway)
+################################################
data("bmi_vichy")
+# the following show how data are processed to get
# statistics for seaonal migration, daily values
bmi_vichy<-calcule(bmi_vichy,timesplit="jour",silent=TRUE)
#bmi_vichy at calcdata #check this to see the results
# statistics for seaonal migration, weekly values
bmi_vichy<-calcule(bmi_vichy,timesplit="semaine",silent=TRUE)
-#bmi_vichy at calcdata
+#bmi_vichy at calcdata
-
-# the plot method also runs calcule
+# the plot method also runs the calcule method
plot(bmi_vichy,plot.type="seasonal",timesplit="semaine",silent=TRUE)
plot(bmi_vichy,plot.type="seasonal",timesplit="mois",silent=TRUE)
plot(bmi_vichy,plot.type="seasonal",timesplit="jour",silent=TRUE)
-
-# A test with lampreys in the Descarte DF (Vienne)
+###############################################
+# Plots for seasonality using another Loire river dataset
+# with the migration of Lampreys (Petromyzon marinus)
+# recorded at the the Descarte DF (Vienne)
+################################################
+# run this only if you are connected to the logrami dataset
baseODBC<-get("baseODBC",envir=envir_stacomi)
baseODBC[c(2,3)]<-rep("logrami",2)
assign("baseODBC",baseODBC,envir_stacomi)
sch<-get("sch",envir=envir_stacomi)
assign("sch","logrami.",envir_stacomi)
-bmi_des<-new("BilanMigrationInterAnnuelle") #descartes
+bmi_des<-new("BilanMigrationInterAnnuelle")
bmi_des<-choice_c(bmi_des,
dc=c(23),
taxons=c("Petromyzon marinus"),
Modified: pkg/stacomir/inst/examples/bilanMigrationMult_Arzal.R
===================================================================
--- pkg/stacomir/inst/examples/bilanMigrationMult_Arzal.R 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/inst/examples/bilanMigrationMult_Arzal.R 2017-06-11 20:35:32 UTC (rev 395)
@@ -3,7 +3,8 @@
stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE)
## launches the application in the command line
## here an example of loading
-## not run as the program is possibly not installed
+## the following lines will only run if you have the program installed
+## and the iav scheme available in the database
## this example generates the bMM_Arzal dataset
\dontrun{
stacomi(gr_interface=FALSE,
@@ -20,7 +21,7 @@
bMM_Arzal<-connect(bMM_Arzal)
}
-
+# Use this as example if you don't have a connexion to the database
data("bMM_Arzal")
# The following re-create the object at the time of loading
# All three classes were created by the charge and connect
@@ -51,18 +52,15 @@
"#A66F24","#012746","#6C3E00","#DC7ED8","#8AA123"),
color_ope=c("#5589B5","#FFDB6E","#FF996E","#1C4D76"),
silent=TRUE)
-
-
-#cumulated migration at the station (all stages and DC grouped)
-
+#For the following plot, beware, all stages and DC are grouped. This can make sense
+# for instance if you want to display the cumulated migration for one species
+# in several counting devices located on the same dam...
plot(bMM_Arzal,plot.type="step",silent=TRUE)
-#some plots are a mixture of french and english
-#changing the reference table names to english should shift all to english.
-#same for spanish.
-# combined plot for ggplot2
+
+# Combined plot for ggplot2
plot(bMM_Arzal,plot.type="multiple",silent=TRUE)
-# data will be written in the data directory specified in
+# Data will be written in the data directory specified in
# the stacomi/calcmig.csv file
summary(bMM_Arzal,silent=TRUE)
}
Modified: pkg/stacomir/man/BilanAnnuels-class.Rd
===================================================================
--- pkg/stacomir/man/BilanAnnuels-class.Rd 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/man/BilanAnnuels-class.Rd 2017-06-11 20:35:32 UTC (rev 395)
@@ -5,7 +5,7 @@
\alias{BilanAnnuels-class}
\title{Class "BilanAnnuels"}
\description{
-Class "BilanAnnuels"
+This class displays annual migration counts, for several counting device, taxa or stages.
}
\section{Slots}{
Modified: pkg/stacomir/man/BilanArgentee-class.Rd
===================================================================
--- pkg/stacomir/man/BilanArgentee-class.Rd 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/man/BilanArgentee-class.Rd 2017-06-11 20:35:32 UTC (rev 395)
@@ -5,7 +5,9 @@
\alias{BilanArgentee-class}
\title{Class "BilanArgentee"}
\description{
-the BilanArgentee class is used to calculate various statistics about the silver eel run
+the BilanArgentee class is used to calculate various statistics about the silver eel run. It comprises calculation
+of various maturation index such as Durif's stages and Pankhurst eye index. The objective is to provide standardized
+output to the stations monitorin the silver eel run.
}
\section{Slots}{
@@ -24,15 +26,15 @@
\item{\code{dc}}{Object of class \link{RefDC-class}: the control devices}
-\item{\code{taxons}}{Object of class \link{RefTaxon-class}: the speciess}
+\item{\code{taxons}}{An object of class \link{RefTaxon-class}: the speciess}
-\item{\code{stades}}{Object of class \link{RefStades-class} : the stages of the fish}
+\item{\code{stades}}{An object of class \link{RefStades-class} : the stages of the fish}
-\item{\code{par}}{Object of class \link{Refpar-class}: the parameters used}
+\item{\code{par}}{An object of class \link{Refpar-class}: the parameters used}
-\item{\code{horodatedebut}}{An object of class \code{RefHorodate-class}}
+\item{\code{horodatedebut}}{An object of class \link{RefHorodate-class}}
-\item{\code{horodatefin}}{An object of class \code{RefHorodate-class}}
+\item{\code{horodatefin}}{An object of class \link{RefHorodate-class}}
}}
\note{
This class is displayed by interface_bilanArgentee
Modified: pkg/stacomir/man/BilanConditionEnv-class.Rd
===================================================================
--- pkg/stacomir/man/BilanConditionEnv-class.Rd 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/man/BilanConditionEnv-class.Rd 2017-06-11 20:35:32 UTC (rev 395)
@@ -8,8 +8,8 @@
\title{class BilanConditionEnv simple output of one or several environmental
conditions...}
\description{
-Annual overview of environmental conditions. Enables to draw some plot. Mostly used to build
-joined graphs for BilanMigration in class BilanMigrationConditionEnv
+Annual overview of environmental conditions. This class enables to draw some plot, but will mostly used to build
+joined graphs crossing the information from \link{BilanMigrationMult-class} and \link{BilanMigrationConditionEnv-class}
}
\section{Slots}{
Modified: pkg/stacomir/man/BilanEspeces-class.Rd
===================================================================
--- pkg/stacomir/man/BilanEspeces-class.Rd 2017-06-10 20:15:21 UTC (rev 394)
+++ pkg/stacomir/man/BilanEspeces-class.Rd 2017-06-11 20:35:32 UTC (rev 395)
@@ -2,13 +2,14 @@
% Please edit documentation in R/BilanEspeces.r
\docType{class}
\name{BilanEspeces-class}
+\alias{BilanEspeces}
\alias{BilanEspeces-class}
\alias{bilanEspeces}
-\title{Class "BilanEspeces" simple migration / number report}
+\title{Counts of number per taxa/stages}
\description{
This class is used to make the assessment of all species, and their number. It is intended
as a simple way to check what fishes are present (taxa + development stage). Unlike the BilanAnnuels,
-it is not restricted on chosen taxa or stages but gives counts for all species present. The taxa is reported unless
+it is not restricted to chosen taxa or stages but gives counts for all species present. The taxa is reported unless
a taxa has several case, in which case the different stages for the taxa will be reported
Using the split arguments
the calc method of the class will count numbers, subsamples are not accounted for in the Overview.
@@ -35,17 +36,6 @@
Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
}
\seealso{
-Other Bilan Classes
-\code{\linkS4class{Bilan_carlot}},
-\code{\linkS4class{Bilan_poids_moyen}},
-\code{\linkS4class{BilanConditionEnv}}, \code{\linkS4class{BilanEspeces}},
-\code{\linkS4class{BilanFonctionnementDC}},
-\code{\linkS4class{BilanFonctionnementDF}},
-\code{\linkS4class{BilanMigration}},
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/stacomir -r 395
More information about the Stacomir-commits
mailing list