Title: | Fish Migration Monitoring |
---|---|
Description: | Graphical outputs and treatment for a database of fish pass monitoring. It is a part of the 'STACOMI' open source project developed in France by the French Office for Biodiversity institute to centralize data obtained by fish pass monitoring. This version is available in French and English. See <http://stacomir.r-forge.r-project.org/> for more information on 'STACOMI'. |
Authors: | Cedric Briand [aut, cre], Marion Legrand [aut], Beaulaton Laurent [ctb], Boulenger Clarisse [ctb], Lafage Denis [ctb], Grall Sebastien [ctb] |
Maintainer: | Cedric Briand <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.6.1 |
Built: | 2025-02-26 03:15:53 UTC |
Source: | https://github.com/cran/stacomiR |
barplot method for object report_annual-class
## S4 method for signature 'report_annual' barplot(height, legend.text = NULL, ...)
## S4 method for signature 'report_annual' barplot(height, legend.text = NULL, ...)
height |
An object of class report_annual |
legend.text |
See barplot help |
... |
additional arguments passed to barplot |
No return value, called for side effects
Cedric Briand [email protected]
report_annual-class for examples
Generic method for calculations
calcule(object, ...)
calcule(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
Calcule method for report_ge_weight
## S4 method for signature 'report_ge_weight' calcule(object, silent = FALSE)
## S4 method for signature 'report_ge_weight' calcule(object, silent = FALSE)
object |
An object of class report_ge_weight-class |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
An object of class report_ge_weight-class with @calcdata[["data"]]
(essentially a selection of
columns and renaming from @data
) and coe
daily coefficients extracted from the database
@calcdata[["coe"]]
and prepared for graphs
Cedric Briand [email protected]
Merges the content of the list elements 'parqual' and 'parquan' in the data slot, and creates a single dataframe with one line per qualitative and quantitative pair. This methods allow to cross one quantity (e.g. length) with a qualitative parameter (e.g. sex).
## S4 method for signature 'report_mig_char' calcule(object, silent = FALSE)
## S4 method for signature 'report_mig_char' calcule(object, silent = FALSE)
object |
An object of class report_mig_char-class |
silent |
Boolean default FALSE, if TRUE information messages not displayed |
An object of class report_mig_char-class with slot @calcdata
filled
Runs the calcule method in report_mig_mult-class
## S4 method for signature 'report_mig_env' calcule(object, silent = FALSE)
## S4 method for signature 'report_mig_env' calcule(object, silent = FALSE)
object |
An object of class report_mig_env-class |
silent |
Boolean default FALSE, if TRUE information messages not displayed |
report_mig_env-class with data in slot r_mig_env@report_mig_mult@calcdata
Performs the calculation of seasonal coefficients for the plot(plot.type="seasonal") method. The numbers are split according to the period chosen, one of "day","week","month","2 weeks", French labels are also accepted as arguments. Once this is done, the seasonality of the migration is displayed using the day when the first fish was seen, then the days (or period) corresponding to 5, 50 , 95, and 100 percent of the migration. The duration of 90
## S4 method for signature 'report_mig_interannual' calcule(object, silent = FALSE, timesplit = "mois")
## S4 method for signature 'report_mig_interannual' calcule(object, silent = FALSE, timesplit = "mois")
object |
An object of class report_mig_interannual-class |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
timesplit |
One of "day","week","month","2 weeks", "jour","semaine","quinzaine","mois" |
An object of class report_mig_interannual-class with calcdata slot filled.
The class report_mig_interannual does not handle escapement rates nor 'devenir' i.e. the destination of the fishes.
Marion Legrand
The calculation must be launched once data are filled by the connect method. Currently the negative argument has no effect.
## S4 method for signature 'report_mig_mult' calcule(object, negative = FALSE, silent = FALSE)
## S4 method for signature 'report_mig_mult' calcule(object, negative = FALSE, silent = FALSE)
object |
An object of class report_mig_mult-class |
negative |
a boolean indicating if a separate sum must be done for positive and negative values, if true, positive and negative counts return different rows |
silent |
Default FALSE, should messages be stopped |
report_mig_mult with a list in slot calcdata. For each dc one will find a list with the following elements
In the case of instantaneous periods (video counting) the sum of daily values is done by the fun_report_mig_mult method and the value indicated in method is 'sum'. If any migration monitoring period is longer than a day, then the migration is split using the fun_report_mig_mult_overlaps function and the value indicated in the method is 'overlaps' as the latter method uses the overlap package to split migration period.
the calculated data. If weight are present, the columns display weight or numbers, the total number is 'Effectif_total' and corresponds to the addition of numbers and numbers converted from weight, the total weight is 'Poids_total'+'poids_depuis_effectifs' and corresponds to weighed glass eel plus glass eel number converted in weights. CALCULE corresponds to calulated number, MESURE to measured numbers, EXPERT to punctual expertise of migration (for instance measured in other path, or known migration of fishes passing the dam but not actually counted, PONCTUEL to fishes counted by visual identification but not by the counting apparatus (in case of technical problem for instance)
A boolean which indicates, in the case of glass eel, that the function fun_weight_conversion has been run to convert the weights to numbers using the weight to number coefficients in the database (see report_ge_weight).
A parameter indicating if negative migration (downstream in the case of upstream migration devices) have been converted to positive numbers, not developed yet
The class does not handle escapement rates, though structurally those are present in the database. If you
want to use those you will have to do the calculation manually from the data in report_mig_mult@data
.
The calculation must be launched once data are filled by the connect method. Currently the negative argument has no effect.
## S4 method for signature 'report_mig' calcule(object, negative = FALSE, silent = FALSE)
## S4 method for signature 'report_mig' calcule(object, negative = FALSE, silent = FALSE)
object |
An object of class |
negative |
a boolean indicating if a separate sum must be done for positive and negative values, if true, positive and negative counts return different rows |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
report_mig with calcdata slot filled. It is a list with one element per counting device containing
In the case of instantaneous periods (video counting) the sum of daily values is done by the fun_report_mig_mult method and the value indicated in method is "sum". If any migration monitoring period is longer than a day, then the migration is split using the fun_report_mig_mult_overlaps function and the value indicated in the method is "overlaps" as the latter method uses the overlap package to split migration period.
the calculated data.
A boolean which indicates, in the case of glass eel, that the function fun_weight_conversion has been run to convert the weights to numbers using the weight to number coefficients in the database (see report_ge_weight).
A parameter indicating if negative migration (downstream in the case of upstream migration devices) have been converted to positive numbers, not developed yet
The class report_mig does not handle escapement rates nor 'devenir' i.e. the destination of the fishes.
In that class, most treatments are done in the query, this method checks that data are available and fills information for year, month, two weeks, week, doy
## S4 method for signature 'report_sample_char' calcule(object, silent = FALSE)
## S4 method for signature 'report_sample_char' calcule(object, silent = FALSE)
object |
An object of class |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
An object of class report_sample_char-class
with slot @data
filled
Cedric Briand [email protected]
If no value are provided in the limit1hm slot, an error is returned, if no value is provided in the limit2hm slot a default upper value for salmon size is taken to ensure all salmon are either of age 1 or 2, but no age 3 are returned
## S4 method for signature 'report_sea_age' calcule(object, silent)
## S4 method for signature 'report_sea_age' calcule(object, silent)
object |
An object of class |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_sea_age-class with calculated data in slot calcdata
Cedric Briand [email protected]
This calcule method for report_silver_eel, will transform data from long (one line per size characteristic, size, weight, eye diameter, pectoral fin measurement, lateral line and constrast) to wide format (one line per silver eel). It will also calculate Durif silvering index and Pankhurst and Fulton's K.
## S4 method for signature 'report_silver_eel' calcule(object, silent)
## S4 method for signature 'report_silver_eel' calcule(object, silent)
object |
An object of class report_silver_eel-class |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
An object of class report_silver_eel-class with slot calcdata filled, as a list for each counting device
Cedric Briand [email protected]
The number will be split according to the split argument passed to the class, e.g. per year or month or week. Data from different DC will be grouped. Counts are given per taxa, unless there are several stages, in which case the counts correspond to taxa + stage.
## S4 method for signature 'report_species' calcule(object, silent = FALSE)
## S4 method for signature 'report_species' calcule(object, silent = FALSE)
object |
An object of class report_species-class |
silent |
Boolean, if TRUE, information messages are not displayed, only warnings and errors |
An object of class report_species-class with calcdata slot filled.
Generic method to load referentials
charge(object, ...)
charge(object, ...)
object |
Object |
... |
Additional parm |
cedric.briand
Generic method to load additional data
charge_complement(object, ...)
charge_complement(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
Loads an additional dataset this method is loaded to obtain the possible values of a qualitative parameter. Here data only contains one line
## S4 method for signature 'ref_parqual' charge_complement(object)
## S4 method for signature 'ref_parqual' charge_complement(object)
object |
An object of class ref_parqual-class |
An S4 object of class ref_parqual-class with the valqual slot filled
Cedric Briand [email protected]
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parqual') object<-charge(object) charge_complement(object) ## End(Not run)
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parqual') object<-charge(object) charge_complement(object) ## End(Not run)
ref_par referential
objects searching only those parameters existing for a DC, a Taxa, and a stageLoading method for ref_par referential
objects searching only those parameters existing for a DC, a Taxa, and a stage
## S4 method for signature 'ref_par' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
## S4 method for signature 'ref_par' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
object |
An object of class ref_par-class |
dc_selected |
A counting device selected for the report |
taxa_selected |
The taxa selected for the report |
stage_selected |
The stage selected for the report |
An S4 object of class ref_par-class
Cedric Briand [email protected]
## Not run: object=new('ref_par') charge_with_filter(object,dc_selected=6,taxa_selected=2038,stage_selected=c('AGJ','CIV')) ## End(Not run)
## Not run: object=new('ref_par') charge_with_filter(object,dc_selected=6,taxa_selected=2038,stage_selected=c('AGJ','CIV')) ## End(Not run)
Loading method for Reparqual referential objects searching only those parameters existing for a DC, a Taxon, and a stage
## S4 method for signature 'ref_parqual' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
## S4 method for signature 'ref_parqual' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
object |
An object of class ref_parqual-class |
dc_selected |
The dc set in the report object |
taxa_selected |
The taxa set in the report object |
stage_selected |
The stage set in the report object |
An S4 object of class ref_parqual-class
Cedric Briand [email protected]
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parqual') charge_with_filter(object,dc_selected,taxa_selected,stage_selected) ## End(Not run)
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parqual') charge_with_filter(object,dc_selected,taxa_selected,stage_selected) ## End(Not run)
Loading method for Reparquan referential objects searching only those parameters existing for a DC (counting device), a Taxon, and a stage
## S4 method for signature 'ref_parquan' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
## S4 method for signature 'ref_parquan' charge_with_filter(object, dc_selected, taxa_selected, stage_selected)
object |
An object of class ref_parquan-class |
dc_selected |
The dc set in the report object |
taxa_selected |
The taxa set in the report object |
stage_selected |
The stage set in the report object |
An S4 object of class ref_parquan-class with data loaded showing available parameters for one DC
Cedric Briand [email protected]
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parquan') charge_with_filter(object,dc_selected,taxa_selected,stage_selected) ## End(Not run)
## Not run: dc_selected=6 taxa_selected=2038 stage_selected='AGJ' object=new('ref_parquan') charge_with_filter(object,dc_selected,taxa_selected,stage_selected) ## End(Not run)
Loading method for ref_stage referential objects searching only those stages existing for a DC and a Taxon
## S4 method for signature 'ref_stage' charge_with_filter(object, dc_selected, taxa_selected)
## S4 method for signature 'ref_stage' charge_with_filter(object, dc_selected, taxa_selected)
object |
An object of class ref_stage-class |
dc_selected |
The selected counting device |
taxa_selected |
The selected species |
An S4 object of class ref_stage-class listing all stages available for one DC and one taxon
Cedric Briand [email protected]
## Not run: dc_selected=6 taxa_selected=2038 object=new('ref_stage') charge_with_filter(object,dc_selected,taxa_selected) ## End(Not run)
## Not run: dc_selected=6 taxa_selected=2038 object=new('ref_stage') charge_with_filter(object,dc_selected,taxa_selected) ## End(Not run)
Loading method for ref_taxa referential objects searching only taxa existing for a DC
## S4 method for signature 'ref_taxa' charge_with_filter(object, dc_selected)
## S4 method for signature 'ref_taxa' charge_with_filter(object, dc_selected)
object |
An object of class ref_taxa-class |
dc_selected |
A counting device selected, only taxa attached to this dc are selected |
An S4 object of class ref_taxa-class with all taxa present on a DC (counting device)
Cedric Briand [email protected]
## Not run: dc_selected=6 object=new('ref_taxa') charge_with_filter(object,dc_selected=dc_selected) ## End(Not run)
## Not run: dc_selected=6 object=new('ref_taxa') charge_with_filter(object,dc_selected=dc_selected) ## End(Not run)
Loading method for Refchoice referential objects
## S4 method for signature 'ref_choice' charge(object, vecteur, label, selected)
## S4 method for signature 'ref_choice' charge(object, vecteur, label, selected)
object |
An object of class ref_choice |
vecteur |
A vector of name, see example code. |
label |
Labels for the choices |
selected |
An integer indicating which object is selected at launch |
An S4 object of class ref_choice-class
Cedric Briand [email protected]
Other referential objects:
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
## Not run: object=new('ref_choice') charge(object,vecteur=c('oui','non'),label='essai',selected=as.integer(1)) ## End(Not run)
## Not run: object=new('ref_choice') charge(object,vecteur=c('oui','non'),label='essai',selected=as.integer(1)) ## End(Not run)
The slots datedebut and datefin have to be filled before using charge
## S4 method for signature 'ref_coe' charge(object)
## S4 method for signature 'ref_coe' charge(object)
object |
An object of class ref_coe-class |
An object of class ref_coe-class
Cedric Briand [email protected]
## Not run: object<- new('ref_coe') object@datedebut<-strptime('01/01/1996',format='%d/%m/%Y') object@datefin<-strptime('01/01/1997',format='%d/%m/%Y') charge(object) ## End(Not run)
## Not run: object<- new('ref_coe') object@datedebut<-strptime('01/01/1996',format='%d/%m/%Y') object@datefin<-strptime('01/01/1997',format='%d/%m/%Y') charge(object) ## End(Not run)
Method to load the counting devices of the control station
## S4 method for signature 'ref_dc' charge(object)
## S4 method for signature 'ref_dc' charge(object)
object |
An object of class ref_dc-class |
an object of class ref_dc with data loaded
Cedric Briand [email protected]
Loading method for DF referential objects
## S4 method for signature 'ref_df' charge(object)
## S4 method for signature 'ref_df' charge(object)
object |
An object of class ref_df-class |
An object of class ref_df with df loaded
Cedric Briand [email protected]
## Not run: object=new('ref_df') charge(object) ## End(Not run)
## Not run: object=new('ref_df') charge(object) ## End(Not run)
Loading method for ref_env referential object
## S4 method for signature 'ref_env' charge(object)
## S4 method for signature 'ref_env' charge(object)
object |
An object of class ref_env-class |
An S4 object of class ref_env with data loaded from the database
Cedric Briand [email protected]
## Not run: object=new('ref_env') charge(object) ## End(Not run)
## Not run: object=new('ref_env') charge(object) ## End(Not run)
Loading method for ref_list referential objects
## S4 method for signature 'ref_list' charge(object, listechoice, label)
## S4 method for signature 'ref_list' charge(object, listechoice, label)
object |
An object of class ref_list-class |
listechoice |
A character vector setting the possible values in which the user can select |
label |
A label for refliste |
An S4 object of class ref_list-class
An S4 object of class ref_list-class
Cedric Briand [email protected]
## Not run: object=new('ref_list') charge(object) ## End(Not run)
## Not run: object=new('ref_list') charge(object) ## End(Not run)
Loading method for ref_par referential objects
## S4 method for signature 'ref_par' charge(object)
## S4 method for signature 'ref_par' charge(object)
object |
An object of class ref_par-class |
An S4 object of class ref_par
An S4 object of class ref_par-class
Cedric Briand [email protected]
## Not run: object=new('ref_par') charge(object) ## End(Not run)
## Not run: object=new('ref_par') charge(object) ## End(Not run)
Loading method for Reparqual referential objects
## S4 method for signature 'ref_parqual' charge(object)
## S4 method for signature 'ref_parqual' charge(object)
object |
An object of class ref_parqual-class |
An S4 object of class ref_parqual
Cedric Briand [email protected]
## Not run: object=new('ref_parqual') charge(object) ## End(Not run)
## Not run: object=new('ref_parqual') charge(object) ## End(Not run)
Loading method for Reparquan referential objects
## S4 method for signature 'ref_parquan' charge(object)
## S4 method for signature 'ref_parquan' charge(object)
object |
An object of class ref_parquan-class |
An S4 object of class ref_parquan-class with data loaded
Cedric Briand [email protected]
## Not run: object=new('ref_parquan') charge(object) ## End(Not run)
## Not run: object=new('ref_parquan') charge(object) ## End(Not run)
Loading method for ref_stage referential objects
## S4 method for signature 'ref_stage' charge(object)
## S4 method for signature 'ref_stage' charge(object)
object |
An object of class ref_stage-class |
An S4 object of class ref_stage-class with all stages available in the database
Cedric Briand [email protected]
## Not run: object=new('ref_stage') charge(object) ## End(Not run)
## Not run: object=new('ref_stage') charge(object) ## End(Not run)
Loading method for ref_taxa referential objects
## S4 method for signature 'ref_taxa' charge(object)
## S4 method for signature 'ref_taxa' charge(object)
object |
An object of class ref_taxa-class |
An S4 object of class ref_taxa
An S4 object of class ref_taxa-class with all taxa loaded from the database
Cedric Briand [email protected]
## Not run: object=new('ref_taxa') charge(object) ## End(Not run)
## Not run: object=new('ref_taxa') charge(object) ## End(Not run)
Loading method for ref_textbox referential objects
## S4 method for signature 'ref_textbox' charge(object, title, label)
## S4 method for signature 'ref_textbox' charge(object, title, label)
object |
An object of class ref_textbox-class |
title |
A title for the frame |
label |
A label for the TextBox |
An S4 object of class ref_textbox-class
Cedric Briand [email protected]
## Not run: object=new('ref_textbox') charge(object,title='un titre',label='20') ## End(Not run)
## Not run: object=new('ref_textbox') charge(object,title='un titre',label='20') ## End(Not run)
Selects year available either in the bjo table if report_object==report_mig_interannual) or in the t_operation_ope table
## S4 method for signature 'ref_year' charge(object, objectreport = "report_ge_weight")
## S4 method for signature 'ref_year' charge(object, objectreport = "report_ge_weight")
object |
An object of class ref_year-class |
objectreport |
The object report, default |
object An object of class ref_year-class with slot data filled with the available years for the corresponding report
Cedric Briand [email protected]
## Not run: object=new("ref_year") charge(object) validObject(annee) showMethods("charge") ## End(Not run)
## Not run: object=new("ref_year") charge(object) validObject(annee) showMethods("charge") ## End(Not run)
#' Unique the other report classes where the charge method is only used by the graphical interface to collect and test objects in the environment envir_stacomi, and see if the right choices have been made in the graphical interface, this methods runs the charge,report_mig_mult-method and needs to be called from the command line (see examples)
## S4 method for signature 'report_mig_env' charge(object, silent = FALSE)
## S4 method for signature 'report_mig_env' charge(object, silent = FALSE)
object |
An object of class report_mig_env-class |
silent |
Should the function remain silent (boolean) |
An object of class report_mig_env-class with data set from values assigned in envir_stacomi
environment
Cedric Briand [email protected]
For the report_mig_mult class the charge method must be run to load data on migration control operations fishway operations, and counting devices operations as data from those are displayed in the main plots. For other classes the charge method is only used by the graphical interface (shiny)
## S4 method for signature 'report_mig_mult' charge(object, silent = FALSE)
## S4 method for signature 'report_mig_mult' charge(object, silent = FALSE)
object |
An object of class report_mig_mult-class |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_mig_mult-class with slots filled from values assigned in envir_stacomi
environment
Cedric Briand [email protected]
this method creates additional classes in envir_stacomi for later use in plot (operations, DF operation, DC operation). So unlike in most report classes where the charge method is only used by the graphical interface, it is necessary to run charge for report_mig.
## S4 method for signature 'report_mig' charge(object, silent = FALSE)
## S4 method for signature 'report_mig' charge(object, silent = FALSE)
object |
An object of class |
silent |
Should the program be returning messages |
An object of class report_mig-class with slots filled from values assigned in envir_stacomi
environment
Cedric Briand [email protected]
Choice_c method for ref_choice referential objects
## S4 method for signature 'ref_choice' choice_c(object, selectedvalue)
## S4 method for signature 'ref_choice' choice_c(object, selectedvalue)
object |
An object of class ref_choice-class |
selectedvalue |
the value selected in the combo |
An S4 object of class ref_choice-class
Cedric Briand [email protected]
## Not run: object=new('ref_list') object<-charge(object,vecteur=c('1','2'),label='please choose') object<-choice_c(object) ## End(Not run)
## Not run: object=new('ref_list') object<-charge(object,vecteur=c('1','2'),label='please choose') object<-choice_c(object) ## End(Not run)
the choice_c method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line. The parameters for dc are transformed to integer as the ref_dc only takes integer in the dc slots. The method also loads the stations and ouvrages (dams) associated with the counting device (dc). The values passed to the choice_c method are then checked with the setValidty method. Finally, if an objectreport is passed as a parameter, the method will do a charge_with_filter to select only the taxa present in the counting devices
## S4 method for signature 'ref_dc' choice_c(object, dc)
## S4 method for signature 'ref_dc' choice_c(object, dc)
object |
an object of class ref_dc |
dc |
a character vector of dc chosen |
An object of class ref_dc with dc selected
Cedric Briand [email protected]
## Not run: win=gwindow() group=ggroup(container=win,horizontal=FALSE) object=new('ref_dc') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,objectreport=objectreport,dc=1) ## End(Not run)
## Not run: win=gwindow() group=ggroup(container=win,horizontal=FALSE) object=new('ref_dc') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,objectreport=objectreport,dc=1) ## End(Not run)
the choice_c method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line. The parameters for dF are transformed to integer as the ref_df only takes integer in the df slots. DF are third in hierarchy in the stacomi database Station>ouvrage>DF>DC>operation. This class is only used in the report_df class.
## S4 method for signature 'ref_df' choice_c(object, df)
## S4 method for signature 'ref_df' choice_c(object, df)
object |
an object of class ref_df-class |
df |
a character vector of df chosen |
An object of class ref_df with df selected
Cedric Briand [email protected]
## Not run: win=gwindow() group=ggroup(container=win,horizontal=FALSE) object=new('ref_df') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,objectreport=objectreport,dc=1) ## End(Not run)
## Not run: win=gwindow() group=ggroup(container=win,horizontal=FALSE) object=new('ref_df') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,objectreport=objectreport,dc=1) ## End(Not run)
the choice_c method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line.
## S4 method for signature 'ref_env' choice_c(object, stationMesure)
## S4 method for signature 'ref_env' choice_c(object, stationMesure)
object |
an object of class ref_env |
stationMesure |
a character vector of the monitoring station code (corresponds to stm_libelle in the tj_stationmesure_stm table) |
an object of class ref_env-class with the monitoring station selected
Cedric Briand [email protected]
Choice_c method for ref_horodate
## S4 method for signature 'ref_horodate' choice_c( object, nomassign = "horodate", funoutlabel = "nous avons le choix dans la date\n", horodate, silent = FALSE )
## S4 method for signature 'ref_horodate' choice_c( object, nomassign = "horodate", funoutlabel = "nous avons le choix dans la date\n", horodate, silent = FALSE )
object |
An object of class ref_horodate-class |
nomassign |
The name assigned in environment envir_stacomi |
funoutlabel |
text displayed by the interface |
horodate |
The horodate to set, formats "%d/%m/%Y %H:%M:%s", "%d/%m/%y %H:%M:%s", "%Y-%m-%d %H:%M:%s" formats can also be passed with the date set to the minute %d/%m/%Y %H:%M or the day %d/%m/%Y ... are accepted. The choice_c method assigns and |
silent |
Default FALSE, should messages be displayed |
An object of class ref_horodate-class with slot horodate set, and assigns an object of class POSIXt with name nomassign in envir_stacomi
Choice_c method for ref_list referential objects
## S4 method for signature 'ref_list' choice_c(object, selectedvalue)
## S4 method for signature 'ref_list' choice_c(object, selectedvalue)
object |
An object of class ref_list-class |
selectedvalue |
the value selected in the combo |
An S4 object of class ref_list-class
the choice method assigns an object of class refList named ref_list in the environment envir_stacomi
Cedric Briand [email protected]
## Not run: object=new('ref_list') object<-charge(object,vecteur=c('1','2'),label='please choose') object<-choice_c(object) ## End(Not run)
## Not run: object=new('ref_list') object<-charge(object,vecteur=c('1','2'),label='please choose') object<-choice_c(object) ## End(Not run)
Command line interface to select a parameter
## S4 method for signature 'ref_par' choice_c(object, par, silent = FALSE)
## S4 method for signature 'ref_par' choice_c(object, par, silent = FALSE)
object |
an object of class ref_par-class |
par |
A character vector of par |
silent |
Default FALSE but not used there |
An object of class ref_par-class
Cedric Briand [email protected]
the choice_c method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line. The values passed to the choice_c method for stage is the code. Any numeric value will be discarded
## S4 method for signature 'ref_stage' choice_c(object, stage, silent = FALSE)
## S4 method for signature 'ref_stage' choice_c(object, stage, silent = FALSE)
object |
An object of class ref_stage-class |
stage |
the vector of stages chosen |
silent |
Boolean, if TRUE, information messages are not displayed |
An S4 object of class ref_stage-class with the stage selected in the data slot
Cedric Briand [email protected]
## Not run: object=new('ref_stage') object<-charge(object) ## End(Not run)
## Not run: object=new('ref_stage') object<-charge(object) ## End(Not run)
the choice_cc method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line. The values passed to the choice_c method for taxa can be either numeric (2038 = Anguilla anguilla) or character.
## S4 method for signature 'ref_taxa' choice_c(object, taxa)
## S4 method for signature 'ref_taxa' choice_c(object, taxa)
object |
An object from the class ref_taxa |
taxa |
The vector of taxa, can be either code (numeric) or latin name |
An S4 object of class ref_taxa-class with data filtered according to the taxa
Cedric Briand [email protected]
## Not run: object=new('ref_taxa') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,'Anguilla anguilla') ## End(Not run)
## Not run: object=new('ref_taxa') object<-charge(object) objectreport=new('report_mig_mult') choice_c(object=object,'Anguilla anguilla') ## End(Not run)
Choice_c method for ref_textbox referential objects
## S4 method for signature 'ref_textbox' choice_c(object, value, nomassign = "ref_textbox")
## S4 method for signature 'ref_textbox' choice_c(object, value, nomassign = "ref_textbox")
object |
An object of class ref_textbox-class |
value |
The value to set |
nomassign |
The name with which the object will be assigned in envir_stacomi |
An S4 object of class ref_textbox-class label selected
Cedric Briand [email protected]
the choice_c method is intended to have the same behaviour as choice (which creates a widget in the graphical interface) but from the command line.
## S4 method for signature 'ref_timestep_daily' choice_c(object, datedebut, datefin)
## S4 method for signature 'ref_timestep_daily' choice_c(object, datedebut, datefin)
object |
An object of class ref_timestep_daily-class |
datedebut |
A character (format |
datefin |
A character |
An S4 object of class ref_timestep_daily-class with date selected
Cedric Briand [email protected]
## Not run: object=new('ref_dc') object<-charge(object) choice_c(object=object,datedebut='2012-01-01',datefin='2013-01-01') ## End(Not run)
## Not run: object=new('ref_dc') object<-charge(object) choice_c(object=object,datedebut='2012-01-01',datefin='2013-01-01') ## End(Not run)
The choice_c method will issue a warning if the year is not present in the database Allows the selection of year and the assignment in environment envir_stacomi
## S4 method for signature 'ref_year' choice_c( object, annee, nomassign = "ref_year", funoutlabel = gettext("Year selected\n", domain = "R-stacomiR"), silent = FALSE )
## S4 method for signature 'ref_year' choice_c( object, annee, nomassign = "ref_year", funoutlabel = gettext("Year selected\n", domain = "R-stacomiR"), silent = FALSE )
object |
An object of class ref_year-class |
annee |
The year to select, either as a character or as a numeric |
nomassign |
The name to be assigned in envir_stacomi |
funoutlabel |
The label that appears in funout |
silent |
Stops messages from being displayed if silent=TRUE, default FALSE |
object An object of class ref_year-class with year selected
Cedric Briand [email protected]
## Not run: object=new("ref_year") object<-charge(object) win=gwindow(title="test ref_year") group=ggroup(container=win,horizontal=FALSE) choice(object,nomassign="ref_year",funoutlabel="essai",titleFrame="essai ref_year",preselect=1) dispose(win) ## End(Not run)
## Not run: object=new("ref_year") object<-charge(object) win=gwindow(title="test ref_year") group=ggroup(container=win,horizontal=FALSE) choice(object,nomassign="ref_year",funoutlabel="essai",titleFrame="essai ref_year",preselect=1) dispose(win) ## End(Not run)
The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class and two slots of ref_year-class
## S4 method for signature 'report_annual' choice_c(object, dc, taxa, stage, start_year, end_year, silent = FALSE)
## S4 method for signature 'report_annual' choice_c(object, dc, taxa, stage, start_year, end_year, silent = FALSE)
object |
An object of class report_annual-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
Either a species name in latin or the SANDRE code for species (ie 2038=Anguilla anguilla), it should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database, see choice_c,ref_stage-method |
start_year |
The starting the first year, passed as character or integer |
end_year |
the finishing year |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_annual-class with data selected
Cedric Briand [email protected]
The choice_c method fills in the data slot for ref_dc, and then uses the choice_c methods of these object to "select" the data.
## S4 method for signature 'report_dc' choice_c(object, dc, horodatedebut, horodatefin, silent = FALSE)
## S4 method for signature 'report_dc' choice_c(object, dc, horodatedebut, horodatefin, silent = FALSE)
object |
An object of class ref_dc-class |
dc |
The dc to set |
horodatedebut |
A POSIXt or Date or character to fix the date of beginning of the report |
horodatefin |
A POSIXt or Date or character to fix the last date of the report |
silent |
Should program be silent or display messages |
An object of class ref_dc-class with data selected
Cedric Briand [email protected]
The choice_c method fills in the data slot for ref_df, and then uses the choice_c methods of these object to "select" the data.
## S4 method for signature 'report_df' choice_c(object, df, horodatedebut, horodatefin, silent = FALSE)
## S4 method for signature 'report_df' choice_c(object, df, horodatedebut, horodatefin, silent = FALSE)
object |
An object of class ref_df-class |
df |
The df to set |
horodatedebut |
A POSIXt or Date or character to fix the date of beginning of the report |
horodatefin |
A POSIXt or Date or character to fix the last date of the report |
silent |
Should program be silent or display messages |
An object of class ref_df-class with data selected
Cedric Briand [email protected]
The choice_c method fills in the data slot for ref_env-class by runnning the charge method of this object. It then runs the choice method on this object. It also applies the choice method for objects of class ref_horodate-class
## S4 method for signature 'report_env' choice_c(object, stationMesure, datedebut, datefin, silent = FALSE)
## S4 method for signature 'report_env' choice_c(object, stationMesure, datedebut, datefin, silent = FALSE)
object |
An object of class report_env-class |
stationMesure |
A character, the code of the monitoring station, which records environmental parameters choice_c,ref_env-method |
datedebut |
The starting date as a character, formats like |
datefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
silent |
Boolean default FALSE, if TRUE information messages not displayed. |
An object of class report_env-class with data selected
Cedric Briand [email protected]
command line interface for report_ge_weight-class
## S4 method for signature 'report_ge_weight' choice_c(object, dc, start_year, end_year, selectedvalue, silent = FALSE)
## S4 method for signature 'report_ge_weight' choice_c(object, dc, start_year, end_year, selectedvalue, silent = FALSE)
object |
An object of class report_ge_weight-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
start_year |
The starting the first year, passed as character or integer |
end_year |
the finishing year, must be > start_year (minimum one year in august to the next in august) |
selectedvalue |
A character to select and object in the ref_list-class |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_ge_weight-class with data selected The choice_c method fills in the data slot for classes ref_dc-class ref_year-class ref_coe-class ref_list-class
Cedric Briand [email protected]
command line interface for report_mig_char class
## S4 method for signature 'report_mig_char' choice_c( object, dc, taxa, stage, parquan = NULL, parqual = NULL, horodatedebut, horodatefin, echantillon = c("with", "without"), silent = FALSE )
## S4 method for signature 'report_mig_char' choice_c( object, dc, taxa, stage, parquan = NULL, parqual = NULL, horodatedebut, horodatefin, echantillon = c("with", "without"), silent = FALSE )
object |
An object of class report_mig_char-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
'2220=Salmo salar', can be a vector with several values these should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
The stages selected, can be a vector with several values |
parquan |
Quantitative parameter |
parqual |
Qualitative parameter |
horodatedebut |
The starting date as a character, formats like |
horodatefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps |
echantillon |
'with' can be 'without', checking without modifies the query in the connect method so that subsamples are not allowed |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_sea_age-class The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class, ref_par-class and two slots of ref_horodate-class and then uses the choice_c methods of these object to select the data.
Cedric Briand [email protected]
command line interface for report_env class
## S4 method for signature 'report_mig_env' choice_c( object, dc, taxa, stage, stationMesure, datedebut, datefin, silent = FALSE )
## S4 method for signature 'report_mig_env' choice_c( object, dc, taxa, stage, stationMesure, datedebut, datefin, silent = FALSE )
object |
An object of class report_env-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
'2038=Anguilla anguilla', these should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
'AGJ=Yellow eel', 'AGG=Silver eel', 'CIV=glass eel' |
stationMesure |
A character, the code of the monitoring station, which records environmental parameters choice_c,ref_env-method |
datedebut |
The starting date as a character, formats like |
datefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
silent |
Boolean default FALSE, if TRUE information messages not displayed. |
An object of class report_env-class with data selected
Cedric Briand [email protected]
command line interface for report_mig_interannual class
## S4 method for signature 'report_mig_interannual' choice_c(object, dc, taxa, stage, start_year, end_year, silent = FALSE)
## S4 method for signature 'report_mig_interannual' choice_c(object, dc, taxa, stage, start_year, end_year, silent = FALSE)
object |
An object of class report_mig_interannual-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
Either a species name in latin or the SANDRE code for species (ie 2038=Anguilla anguilla), it should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database, see choice_c,ref_stage-method |
start_year |
The starting the first year, passed as character or integer |
end_year |
the finishing year |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_mig_interannual-class with data selected The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class and two slots of ref_year-class
Cedric Briand [email protected]
The choice_c method fills in the data slot for ref_dc, ref_taxa, ref_stage and then uses the choice_c methods of these object to 'select' the data.
## S4 method for signature 'report_mig_mult' choice_c(object, dc, taxa, stage, datedebut, datefin, silent = FALSE)
## S4 method for signature 'report_mig_mult' choice_c(object, dc, taxa, stage, datedebut, datefin, silent = FALSE)
object |
An object of class report_mig-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
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 choice_c,ref_taxa-method |
stage |
A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database see choice_c,ref_stage-method |
datedebut |
The starting date as a character, formats like |
datefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
silent |
Should messages be hided default FALSE |
An object of class report_mig_mult-class with data selected
Cedric Briand [email protected]
The choice_c method fills in the data slot for ref_dc, ref_taxa, ref_stage, and refref_timestep_daily and then uses the choice_c methods of these object to select the data.
## S4 method for signature 'report_mig' choice_c(object, dc, taxa, stage, datedebut, datefin)
## S4 method for signature 'report_mig' choice_c(object, dc, taxa, stage, datedebut, datefin)
object |
An object of class report_mig-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
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 choice_c,ref_taxa-method |
stage |
A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database see choice_c,ref_stage-method |
datedebut |
The starting date as a character, formats like |
datefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
An object of class report_mig-class with data selected
Cedric Briand [email protected]
#' The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class, ref_par-class and two slots of ref_horodate-class and then uses the choice_c methods of these object to select the data.
## S4 method for signature 'report_sample_char' choice_c( object, dc, taxa, stage, par, horodatedebut, horodatefin, silent = FALSE )
## S4 method for signature 'report_sample_char' choice_c( object, dc, taxa, stage, par, horodatedebut, horodatefin, silent = FALSE )
object |
An object of class report_sample_char-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
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 choice_c,ref_taxa-method |
stage |
A stage code matching the ref.tr_stadedeveloppement_std table in the stacomi database, see choice_c,ref_stage-method |
par |
A parameter matching th ref.tg_parametre_par table in the stacomi database, see choice_c,ref_par-method |
horodatedebut |
The starting date as a character, formats like |
horodatefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_mig-class with data selected
Cedric Briand [email protected]
#' The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class, ref_par-class and two slots of ref_horodate-class and then uses the choice_c methods of these object to select the data.
## S4 method for signature 'report_sea_age' choice_c( object, dc, taxa = 2220, stage = c("5", "11", "BEC", "BER", "IND"), par = c("1786", "1785", "C001", "A124"), horodatedebut, horodatefin, limit1hm, limit2hm, silent = FALSE )
## S4 method for signature 'report_sea_age' choice_c( object, dc, taxa = 2220, stage = c("5", "11", "BEC", "BER", "IND"), par = c("1786", "1785", "C001", "A124"), horodatedebut, horodatefin, limit1hm, limit2hm, silent = FALSE )
object |
An object of class report_sea_age-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
'2220=Salmo salar', these should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
'5','11','BEC','BER','IND' |
par |
Parameters chosen for the report are measured body size (1786), measured fork length (1785),video size (C001) and number of year at sea (A124) |
horodatedebut |
The starting date as a character, formats like |
horodatefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
limit1hm |
Size limit of a salmon for an one sea winter fish |
limit2hm |
Size limit of a salmon for a two sea winter fish |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_sea_age-class
Cedric Briand [email protected]
#' The choice_c method fills in the data slot for classes ref_dc-class, ref_taxa-class, ref_stage-class, ref_par-class and two slots of ref_horodate-class and then uses the choice_c methods of these object to select the data.
## S4 method for signature 'report_silver_eel' choice_c( object, dc, taxa = 2038, stage = "AGG", par = c("1786", "CCCC", "BBBB", "CONT", "LINP", "A111", "PECT"), horodatedebut, horodatefin, silent = FALSE )
## S4 method for signature 'report_silver_eel' choice_c( object, dc, taxa = 2038, stage = "AGG", par = c("1786", "CCCC", "BBBB", "CONT", "LINP", "A111", "PECT"), horodatedebut, horodatefin, silent = FALSE )
object |
An object of class report_silver_eel-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
'2038=Anguilla anguilla', these should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
stage |
'AGG' |
par |
Parameters chosen for the report are body size (1786), vertical eye diameter (BBBB), horizontal eye diameter (CCCC), body contrast (CONT), presence of punctuation on the lateral line (LINP), length of the pectoral fin (PECT) |
horodatedebut |
The starting date as a character, formats like |
horodatefin |
The finishing date of the report, for this class this will be used to calculate the number of daily steps. |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_mig-class
Cedric Briand [email protected]
command line interface for report_species-class
## S4 method for signature 'report_species' choice_c( object, dc, taxa = "all", split = "none", start_year, end_year, silent = FALSE )
## S4 method for signature 'report_species' choice_c( object, dc, taxa = "all", split = "none", start_year, end_year, silent = FALSE )
object |
An object of class report_species-class |
dc |
A numeric or integer, the code of the dc, coerced to integer,see choice_c,ref_dc-method |
taxa |
Either 'all' (default) or a species name in latin or the SANDRE code for species (ie 2038=Anguilla anguilla), it should match the ref.tr_taxon_tax referential table in the stacomi database, see choice_c,ref_taxa-method |
split |
one of c('none','week','month','year') |
start_year |
The starting the first year, passed as character or integer |
end_year |
the finishing year |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_species-class with data selected
Cedric Briand [email protected]
Classification scores are calculated by multiplying the metrics BL = body length, W = weight, MD = mean eye diameter (Dv+Dh)/2, and FL length of the pectoral fin, with each parameter p as S=Constant+BL*p(bl)+W*p(W)... The stage chosen is the one achieving the highest score
coef_durif
coef_durif
An object of class matrix
(inherits from array
) with 5 rows and 6 columns.
Durif, C.M., Guibert, A., and Elie, P. 2009. Morphological discrimination of the silvering stages of the European eel. In American Fisheries Society Symposium. pp. 103-111. https://fishlarvae.org/common/SiteMedia/durif%20et%20al%202009b.pdf
Builds a table with colors to merge with a dataframe for later use in ggplot. An initial check will be done on the name of the color vector. A data frame is built. It contains a column color which is a factor. The factor order match the order of the vector (not the alphabetical order of the colors).
colortable( color = NULL, vec, palette = "Set2", color_function = c("brewer.pal", "gray.colors", "random") )
colortable( color = NULL, vec, palette = "Set2", color_function = c("brewer.pal", "gray.colors", "random") )
color |
Either null (default) or a named vector of colors, the names should correspond to the values of vec |
vec |
The vector to match the color with, if a named vector or color is supplied the names should match |
palette |
the name of the RColorBrewer palette, defaults to "Set2", ignored for other color gradient functions and if a named vector of colors is provided |
color_function |
the name of the function used to brew the colors, one for "brewer.pal", "gray.colors", "random", default to "brewer.pal, this argument is ignored if a named vector of color is passed. |
A dataframe with two columns, the vector (name) and the color (color) as a reordered factor
Cedric Briand [email protected]
connect method for report_annual class this method performs the sum over the year attention this function does not count subsamples.
## S4 method for signature 'report_annual' connect(object, silent = FALSE)
## S4 method for signature 'report_annual' connect(object, silent = FALSE)
object |
An object of class report_annual-class |
silent |
Stops messages from being displayed if silent=TRUE, default FALSE |
An instantiated object with values filled with user choice
An object of class report_annual-class including a dataframe with column effectif, comprising the sum of report_mig counts
Cedric Briand [email protected]
loads the working periods and type of arrest or disfunction of the DC
## S4 method for signature 'report_dc' connect(object, silent = FALSE)
## S4 method for signature 'report_dc' connect(object, silent = FALSE)
object |
An object of class report_dc-class |
silent |
boolean, default FALSE, if TRUE messages are not displayed |
An object of class report_dc-class with slot data filled from the database
cedric.briand
connect method for report_df
## S4 method for signature 'report_df' connect(object, silent = FALSE)
## S4 method for signature 'report_df' connect(object, silent = FALSE)
object |
An object of class report_df-class loads the working periods and type of arrest or disfunction of the DF |
silent |
Boolean, TRUE removes messages. |
An object of class report_df
with slot data filled from the database
cedric.briand
connect method for report_env class
## S4 method for signature 'report_env' connect(object, silent = FALSE)
## S4 method for signature 'report_env' connect(object, silent = FALSE)
object |
An object of class report_env-class |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_env-class with slot data filled from the database
Cedric Briand [email protected]
The connect method adapts queries according to user choices, mean weight w is calculated as car_valeur_quantitatif/lot_effectif. These coefficients are stored in the database, and the connect method loads them from the table using the ref_coe-class
## S4 method for signature 'report_ge_weight' connect(object, silent = TRUE)
## S4 method for signature 'report_ge_weight' connect(object, silent = TRUE)
object |
An object of class report_ge_weight-class |
silent |
Should the method be silent |
An object of class report_ge_weight-class with slots data and coe filled from the database
dates for the request are from august to august (a glass eel season)
Cedric Briand [email protected]
uses the report_mig_mult method
## S4 method for signature 'report_mig_char' connect(object, silent = FALSE)
## S4 method for signature 'report_mig_char' connect(object, silent = FALSE)
object |
An object of class report_mig_char-class |
silent |
Boolean default FALSE, if TRUE information messages not displayed |
An object of class report_mig_char-class with list in @data$parquan
and @data$parqual
filled in from the database
connect method for report_mig_env class
## S4 method for signature 'report_mig_env' connect(object, silent = FALSE)
## S4 method for signature 'report_mig_env' connect(object, silent = FALSE)
object |
An object of class report_mig_env-class |
silent |
Default FALSE, if TRUE the program should no display messages |
an object of report_mig_env class
Cedric Briand [email protected]
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 report_mig (which has a write_database methode to write daily reports) for those years.
## S4 method for signature 'report_mig_interannual' connect(object, silent = FALSE, check = TRUE)
## S4 method for signature 'report_mig_interannual' connect(object, silent = FALSE, check = TRUE)
object |
An object of class report_mig_interannual-class |
silent |
Stops messages from being displayed if silent=TRUE, default FALSE |
check |
Checks that data are corresponding between report_annual and report_mig |
report_mig_interannual an instantiated object with values filled with user choice
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.
Cedric Briand [email protected]
this method loads data from the database for report_mig but also fills the table of conversion coefficient, if
the taxa is eel. It also calls connect method for report_df-class,
report_dc-class and report_ope-class associated with the report
and used by the fungraph and fungraph_glasseel functions. As a side effect it assigns
objects report_dc-class, report_df-class and report_ope-class in environment envir_stacomi
## S4 method for signature 'report_mig_mult' connect(object, silent = FALSE)
## S4 method for signature 'report_mig_mult' connect(object, silent = FALSE)
object |
An object of class report_mig_mult-class |
silent |
Boolean, if TRUE messages are not displayed |
An object of class report_mig_mult-class with slot @data filled from the database
uses the report_mig_mult method
## S4 method for signature 'report_mig' connect(object, silent = FALSE)
## S4 method for signature 'report_mig' connect(object, silent = FALSE)
object |
An object of class report_mig-class |
silent |
Boolean default FALSE, if TRUE information messages not displayed |
report_mig with slot @data
filled from the database
connect method for report_ope
## S4 method for signature 'report_ope' connect(object, silent = FALSE)
## S4 method for signature 'report_ope' connect(object, silent = FALSE)
object |
An object of class report_ope-class load data from the operation table, one dataset per DC |
silent |
Boolean, TRUE removes messages. |
An object of class report_ope-class with slot data @data
filled
cedric.briand
connect method for report_sample_char
## S4 method for signature 'report_sample_char' connect(object, silent = FALSE)
## S4 method for signature 'report_sample_char' connect(object, silent = FALSE)
object |
An object of class report_sample_char-class |
silent |
Boolean if TRUE messages are not displayed |
An object of class report_sample_char-class with slot data @data
filled
Cedric Briand [email protected]
connect method for report_sea_age
## S4 method for signature 'report_sea_age' connect(object, silent = FALSE)
## S4 method for signature 'report_sea_age' connect(object, silent = FALSE)
object |
An object of class report_sea_age-class |
silent |
Default FALSE, if TRUE the program should no display messages |
An object of class report_sea_age-class with slot data @data
filled
Cedric Briand [email protected]
connect method for report_silver_eel
## S4 method for signature 'report_silver_eel' connect(object, silent = FALSE)
## S4 method for signature 'report_silver_eel' connect(object, silent = FALSE)
object |
An object of class report_silver_eel-class |
silent |
Boolean if TRUE messages are not displayed |
An object of class report_silver_eel-class with slot data @data
filled
Cedric Briand [email protected]
connect method for report_species
## S4 method for signature 'report_species' connect(object, silent = FALSE)
## S4 method for signature 'report_species' connect(object, silent = FALSE)
object |
An object of class report_species |
silent |
Boolean, if TRUE, information messages are not displayed |
An object of class report_species-class with data slot filled with slot data @data
filled
Cedric Briand [email protected]
envir_stacomi envir_stacomi <- new.env(parent = baseenv())
is the
environment where most object created by the interface are stored
This is where the graphical interface stores its objects
try ls(envir=envir_stacomi)
This is where the graphical interface stores its objects
try ls(envir=envir_stacomi)
envir_stacomi envir_stacomi envir_stacomi
envir_stacomi envir_stacomi envir_stacomi
An object of class environment
of length 0.
An object of class environment
of length 0.
An object of class environment
of length 0.
Cedric Briand [email protected]
Each time a report mig runs, it can write its content in the t_bilanmigrationjournalier_bjo table which stores the results of the report_mig with one value per day
fn_connect_report_mig_interannual(years, taxa, stage, dc)
fn_connect_report_mig_interannual(years, taxa, stage, dc)
years |
A vector of years |
taxa |
One taxa |
stage |
One stage |
dc |
A vector of counting devices |
a data frame with the content of table t_bilanmigrationjournalier_bjo in the database
Calculates a data.frame where all components within the list calcdata are aggregated and formatted for plot
fun_aggreg_for_plot(object)
fun_aggreg_for_plot(object)
object |
An object of class report_mig_mult-class |
A data.frame
Cedric Briand [email protected]
function used to remove special non utf8 character which cause the gtk interface to crash
fun_char_spe(text)
fun_char_spe(text)
text |
a text string which might contain no utf8 characters |
text
Cedric Briand [email protected]
This function extracts temporal characteristics from a dataframe
fun_date_extraction( data, nom_coldt, annee = TRUE, mois = TRUE, quinzaine = FALSE, semaine = TRUE, semaine_std = FALSE, jour_an = FALSE, jour_mois = TRUE, heure = FALSE )
fun_date_extraction( data, nom_coldt, annee = TRUE, mois = TRUE, quinzaine = FALSE, semaine = TRUE, semaine_std = FALSE, jour_an = FALSE, jour_mois = TRUE, heure = FALSE )
data |
a data frame containing a Date or POSIXt column |
nom_coldt |
the name of the column containing date or POSIXt entry to be processed |
annee |
logical do you want a column describing year to be added to the dataframe |
mois |
logical, add column with month |
quinzaine |
logical, add column with 15 days |
semaine |
logical, add column with weeks |
semaine_std |
logical, add column with standard weeks (using isoweek from lubridate) |
jour_an |
logical, add column with day of year |
jour_mois |
logical, add column with day of month |
heure |
logical, add column with hour |
The dataframe with date column filled
Cedric Briand [email protected]
statistics per time period
fun_report_mig_interannual(dat, year = NULL, timesplit = NULL)
fun_report_mig_interannual(dat, year = NULL, timesplit = NULL)
dat |
a data frame with columns ("bjo_annee","bjo_jour","bjo_labelquantite","bjo_valeur") |
year |
The year to exclude from the historical series (it will be plotted against the historical series) |
timesplit |
"week" "2 weeks" "month" as provided to seq.POSIXt, default NULL |
a data frame with mean, max, and min calculated for each timesplit
Function to calculate daily migration from migration monitoring whose length is less than one day, typically video recording whose period are instant events.
fun_report_mig_mult(time.sequence, datasub, negative = FALSE)
fun_report_mig_mult(time.sequence, datasub, negative = FALSE)
time.sequence |
the time sequence to be filled in with new data |
datasub |
the initial dataset |
negative |
'boolean', default FALSE, TRUE indicates a separate sum for negative and positive migrations |
A data.frame with number summed over over the time.sequence. The function returns the same output than fun_report_mig_mult_overlaps but is intended to work faster. In the data.frame, the total number is 'Effectif_total' and corresponds to the addition of numbers and numbers converted from weight, the total weight is 'Poids_total'+'poids_depuis_effectifs' and corresponds to weighed glass eel plus glass eel number converted in weights.
Cedric Briand [email protected]
Function to calculate daily migration from migration monitoring whose length is more than one day, this calculation relies on the (false) assumption that migration is evenly spread over time.
fun_report_mig_mult_overlaps(time.sequence, datasub, negative = FALSE)
fun_report_mig_mult_overlaps(time.sequence, datasub, negative = FALSE)
time.sequence |
the time sequence to be filled in with new data |
datasub |
the initial dataset |
negative |
'boolean', default FALSE, TRUE indicates a separate sum for negative and positive migrations to time.sequence period and summed over the new sequence. A migration operation spanning several days will be converted to 'daily' values assuming that the migration was regular over time. The function returns one row per taxa, stages, counting device. It does not account for the destination of taxa. It returns separate rows for quantities and numbers. Several columns are according to the type of measure (MESURE, CALCULE, PONCTUEL or EXPERT). |
A data.frame with daily migrations
Cedric Briand [email protected]
calcule,report_mig_mult-method
Creates a list of available schemas in the db
fun_schema()
fun_schema()
A table with of data providers with org_code, the user of each schema, and org_description the description of the schema
Function to calculate the stages from Durif
fun_stage_durif(data)
fun_stage_durif(data)
data |
A dataset with columns BL, W, Dv, Dh, FL corresponding to body length (mm), Weight (g), vertical eye diameter (mm), vertical eye diameter (mm), and pectoral fin length (mm) |
A data.frame with durif stages per individual
Laurent Beaulaton [email protected]
functions called in DF and DC
fun_table_per_dis( typeperiode, tempsdebut, tempsfin, libelle, color, date = TRUE )
fun_table_per_dis( typeperiode, tempsdebut, tempsfin, libelle, color, date = TRUE )
typeperiode |
ref.tr_typearretdisp_tar(per_tar_code) the code of the period (see table ref.tr_typearretdisp_tar) |
tempsdebut |
ref.tr_typearretdisp_tar(per_date_debut) starting timestamp of the period |
tempsfin |
The postgres column ref.tr_typearretdisp_tar(per_date_fin) ending timestamp of the period |
libelle |
The postgres column ref.tr_typearretdisp_tar(libelle )description of the period type |
color |
A named vector of color matching libelle. |
date |
Boolean, should the function return a POSIXt or date value |
A list
returns either POSIXt or date if date=TRUE
Cedric Briand [email protected]
returns a table where weights and number are calculated from number and weights respectively performs a query to collect the conversion coefficients
fun_weight_conversion(tableau, time.sequence, silent)
fun_weight_conversion(tableau, time.sequence, silent)
tableau |
Table issued from report_mig |
time.sequence |
Time sequence from report_mig |
silent |
If silent=TRUE do not display messages |
tableau, the data frame with weight converted to numbers
Cedric Briand [email protected]
This writes monthly data in t_reportmensuel_mens table
fun_write_monthly(report_mig, resum, silent)
fun_write_monthly(report_mig, resum, silent)
report_mig |
an object of class |
resum |
data frame with summary per month |
silent |
Suppresses messages |
No return value, called for side effects
This function is launched by fun_write_daily, the resum dataset is created by the funstat function
This graph is for species other than glass eel
fungraph( report_mig, tableau, time.sequence, taxa, stage, dc = NULL, silent, color = NULL, color_ope = NULL, ... )
fungraph( report_mig, tableau, time.sequence, taxa, stage, dc = NULL, silent, color = NULL, color_ope = NULL, ... )
report_mig |
An object of class |
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 |
time.sequence |
A vector POSIXt |
taxa |
The species |
stage |
The stage |
dc |
The DC |
silent |
Message displayed or not |
color |
Default NULL, a vector of color in the following order, working, stopped, 1...5 types of operation for the fishway or DC, measured, calculated, expert, direct observation. If null will be set to brewer.pal(12,"Paired")[c(8,10,4,6,1,2,3,5,7)] |
color_ope |
Default NULL, a vector of color for the operations. Default to brewer.pal(4,"Paired") |
... |
additional parameters passed to matplot, main, ylab, ylim, lty, pch, bty, cex.main, it is currenly not a good idea to change xlim (numbers are wrong, the month plot covers all month, and legend placement is wrong |
No return value, called for side effects
this function is intended to be called from the plot method in report_mig_mult and report_mig
Cedric Briand [email protected]
This graph will also plot numbers and bars according to whether the glass eel have been counted through weight or numbers
fungraph_glasseel( report_mig, table, time.sequence, taxa, stage, dc = null, silent, color = NULL, color_ope = NULL, ... )
fungraph_glasseel( report_mig, table, time.sequence, taxa, stage, dc = null, silent, color = NULL, color_ope = NULL, ... )
report_mig |
an object of class report_mig-class or an object of class report_mig_mult-class |
table |
a data frame with the results |
time.sequence |
a vector POSIXt |
taxa |
the species |
stage |
the stage |
dc |
the counting device, default to null, only necessary for report_mig_mult-class |
silent |
Message displayed or not |
color |
Default NULL, a vector of length 11 of color in the following order, numbers, weight, working, stopped, 1...5 types of operation, the 2 latest colors are not used but kept for consistency with fungraph for the fishway, if null will be set to brewer.pal(12,"Paired")[c(4,6,1,2,3,5,7,8,10,11,12)] |
color_ope |
Default NULL, a vector of color for the operations. Default to brewer.pal(4,"Paired") |
... |
additional parameters passed to plot, main, ylab, cex.main, font.main, type, xlim, ylim, lty, bty, pch it is not possible to change xlim |
No return value, called for side effects
Cedric Briand [email protected]
Function to calculate statistics per month
funstat(tableau, time.sequence, taxa, stage, DC, silent)
funstat(tableau, time.sequence, taxa, stage, DC, silent)
tableau |
A table 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 |
time.sequence |
Passed from report_mig or report_mig_mult |
taxa |
Taxa |
stage |
The Stage |
DC |
The counting device |
silent |
Message displayed or not |
No return value, called for side effects
this function is intended to be called from within the summary method
Cedric Briand [email protected]
function to print and save statistics in .csv and .html formats for report_mig and report_mig_mult class
funtable(tableau, time.sequence, taxa, stage, DC, resum, silent)
funtable(tableau, time.sequence, taxa, stage, DC, resum, silent)
tableau |
A table 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 |
time.sequence |
Passed from report_mig or report_mig_mult |
taxa |
Taxa |
stage |
The Stage |
DC |
The counting device |
resum |
A summary table generated by funstat |
silent |
If TRUE, all messages turned off (except warnings and errors) |
No return value, called for side effects
this function is intended to be called from within the summary method
Cedric Briand [email protected]
Generic method getvalue
getvalue(object, ...)
getvalue(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
function used for some lattice graphs with dates
graphdate(vectordate)
graphdate(vectordate)
vectordate |
date or POSIXt |
vectordate (without class)
Cedric Briand [email protected]
Generic for prediction
model(object, ...)
model(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
model method for report_ge_weight' this method uses samples collected over the season to model the variation in weight of glass eel or yellow eels.
## S4 method for signature 'report_ge_weight' model(object, model.type = "seasonal", silent = FALSE)
## S4 method for signature 'report_ge_weight' model(object, model.type = "seasonal", silent = FALSE)
object |
An object of class report_ge_weight-class |
model.type |
default 'seasonal', 'seasonal1','seasonal2','manual'. |
silent |
Default FALSE, if TRUE the program should no display messages |
Depending on model.type several models are produced
The simplest model uses a seasonal variation, it is fitted with a sine wave curve allowing a cyclic variation w ~ a*cos(2*pi*(d'-T)/365)+b with a period T. The modified day d' used is this model is set at 1 the 1st of august doy = d' + d0; d0 = 212, doy=julian days
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.
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 ,
where vt is the time index variable
is a constant that describes how the index variable relates to the full period
(here,
). The model is written as following
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.
An object of class report_ge_weight-class with @calcdata[["import_coe"]]
filled.
Cedric Briand [email protected]
Plot method for report_annual
## S4 method for signature 'report_annual,missing' plot(x, plot.type = "point", silent = FALSE)
## S4 method for signature 'report_annual,missing' plot(x, plot.type = "point", silent = FALSE)
x |
An object of class report_annual-class |
plot.type |
Default point |
silent |
Stops displaying the messages.
|
No return value, called for side effects
Cedric Briand [email protected]
report_mig_interannual-class for examples
A barplot of the operation time per month
Barchat giving the time per type of operation
Rectangle plots drawn along a line
Plots per day drawn over the period to show the operation of a df, days in x, hours in y
## S4 method for signature 'report_dc,missing' plot( x, plot.type = 1, silent = FALSE, main = NULL, color_type_oper = c(`Fonc normal` = "#76BEBE", `Arr ponctuel` = "#FF6700", `Arr maint` = "#9E0142", Dysfonc = "#EE1874", `Non connu` = "#999999"), color_etat = c(`TRUE` = "#0F313A", `FALSE` = "#CEB99A") )
## S4 method for signature 'report_dc,missing' plot( x, plot.type = 1, silent = FALSE, main = NULL, color_type_oper = c(`Fonc normal` = "#76BEBE", `Arr ponctuel` = "#FF6700", `Arr maint` = "#9E0142", Dysfonc = "#EE1874", `Non connu` = "#999999"), color_etat = c(`TRUE` = "#0F313A", `FALSE` = "#CEB99A") )
x |
An object of class report_dc-class. |
plot.type |
1 to 4, barplot, barchart, rectangle plot and box showing details of daily operation, a plot with adjacent rectangles. |
silent |
Stops displaying the messages default to FALSE |
main |
The title of the graph, if NULL a default title will be plotted with the number of the DF. |
color_type_oper |
Named vector of color for the graph, must match type operation default to c("Fonc normal" = "#76BEBE", "Arr ponctuel" = "#FF6700", "Arr maint" = "#9E0142", "Dysfonc" = "#EE1874", "Non connu" = "#999999"). |
color_etat |
Named vector state value (must match the names "TRUE", "FALSE"). |
Nothing but prints the different plots.
The program cuts periods which overlap between two month.
The splitting of different periods into month is
assigned to the envir_stacomi
environment.
Cedric Briand [email protected]
A barplot of the operation time per month
Barchat giving the time per type of operation
Rectangle plots drawn along a line
Plots per day drawn over the period to show the operation of a df, days in x, hours in y
## S4 method for signature 'report_df,missing' plot( x, plot.type = 1, silent = FALSE, main = NULL, color_type_oper = c(`Fonc normal` = "#1B9E77", `Arr ponctuel` = "#E6AB02", `Arr maint` = "#9E0142", Dysfonc = "#E41A1C", `Non connu` = "#999999"), color_etat = c(`TRUE` = "chartreuse3", `FALSE` = "orangered3") )
## S4 method for signature 'report_df,missing' plot( x, plot.type = 1, silent = FALSE, main = NULL, color_type_oper = c(`Fonc normal` = "#1B9E77", `Arr ponctuel` = "#E6AB02", `Arr maint` = "#9E0142", Dysfonc = "#E41A1C", `Non connu` = "#999999"), color_etat = c(`TRUE` = "chartreuse3", `FALSE` = "orangered3") )
x |
An object of class report_df-class. |
plot.type |
1 to 4. |
silent |
Stops displaying the messages. |
main |
The title of the graph, if NULL a default title will be plotted with the number of the DF. |
color_type_oper |
Named vector of color for the graph, must match type operation default to c( "Fonc normal" = "#1B9E77","Arr ponctuel" = "#E6AB02", "Arr maint" = "#9E0142", "Dysfonc" = "#E41A1C","Non connu" = "#999999"). |
color_etat |
Named vector state value (must match the names "TRUE", "FALSE"). |
Nothing but prints the different plots.
The program cuts periods which overlap between two month. The splitting of different periods into month is
assigned to the envir_stacomi
environment.
Cedric Briand [email protected]
Plot method for report_env
## S4 method for signature 'report_env,missing' plot(x, silent = FALSE)
## S4 method for signature 'report_env,missing' plot(x, silent = FALSE)
x |
An object of class report_env-class |
silent |
Stops displaying the messages |
Nothing, called for its side effect of plotting data
Cedric Briand [email protected]
Plot method for report_ge_weight'
## S4 method for signature 'report_ge_weight,missing' plot(x, plot.type = 1, silent = FALSE)
## S4 method for signature 'report_ge_weight,missing' plot(x, plot.type = 1, silent = FALSE)
x |
An object of class report_ge_weight-class |
plot.type |
Default '1'. '1' plot of mean weight of glass eel against the mean date of operation (halfway between start,
and end of operation). The ggplot 'p' can be accessed from envir_stacomi using |
silent |
Stops displaying the messages |
Nothing, called for its side effect of plotting data
the model method provides plots for the fitted models
Cedric Briand [email protected]
plot method for report_mig_char
## S4 method for signature 'report_mig_char,missing' plot(x, color_parm = NULL, plot.type = "qual", silent = FALSE, ...)
## S4 method for signature 'report_mig_char,missing' plot(x, color_parm = NULL, plot.type = "qual", silent = FALSE, ...)
x |
An object of class report_mig_char |
color_parm |
A named vector for the colors of either parameters (if plot.type=quant) or levels for parameters (if plot.type=qual). |
plot.type |
One of 'qual', 'quant' 'crossed' default to qual |
silent |
Boolean default FALSE, if TRUE information messages not displayed |
... |
Additional parameters |
Nothing, called for its side effect of plotting data
Cedric Briand [email protected]
Plot method for report_mig_env
## S4 method for signature 'report_mig_env,missing' plot(x, color_station = NULL, color_dc = NULL, silent = FALSE)
## S4 method for signature 'report_mig_env,missing' plot(x, color_station = NULL, color_dc = NULL, silent = FALSE)
x |
An object of class report_mig_env |
color_station |
A named vector of station color (e.g. c("temp_gabion"="red","coef_maree"="blue","phases_lune"="green")) default null |
color_dc |
A named vector giving the color for each dc default null (e.g. c("5"="#4D4D4D","6"="#E6E6E6","12"="#AEAEAE")) |
silent |
Stops displaying the messages. |
Nothing, called for its side effect of plotting
Cedric Briand [email protected]
Several of these plots are scaled against the same year,i.e.the comparison is based on year 2000, meaning that day 1 would correspond to the first date of 2000, which is also a saturday, the last day of the week.
## S4 method for signature 'report_mig_interannual,missing' plot( x, plot.type = "standard", timesplit = "month", year_choice = NULL, alpha = 1, silent = FALSE )
## S4 method for signature 'report_mig_interannual,missing' plot( x, plot.type = "standard", timesplit = "month", year_choice = NULL, alpha = 1, silent = FALSE )
x |
An object of class report_mig_interannual-class |
plot.type |
Default standard |
timesplit |
Used for plot.type barchart or dotplot, Default month other possible values are day, week, 2 weeks, month French values "jour" "semaine" "quinzaine" "mois" are also accepted. |
year_choice |
The year chosen to calculate statistics which will be plotted against the historical series, should be a character vector of length one e.g. '2012', default NULL, when NULL the latest year is selected. |
alpha |
argument passed when plot.type=barchart, pointrange, standard default 1 |
silent |
Stops displaying the messages.
|
Nothing, called for its side effect of plotting
Cedric Briand [email protected]
calls fungraph
and 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
creates Cumulated graphs for report_mig_mult. Data are summed per day for different dc taxa and stages
Method to overlay graphs for report_mig_mult (multiple dc/taxa/stage in the same plot)
## S4 method for signature 'report_mig_mult,missing' plot( x, plot.type = "standard", color = NULL, color_ope = NULL, silent = FALSE, ... )
## S4 method for signature 'report_mig_mult,missing' plot( x, plot.type = "standard", color = NULL, color_ope = NULL, silent = FALSE, ... )
x |
An object of class report_mig_mult |
plot.type |
One of 'standard','step','multiple'. Defaut to |
color |
Default NULL, argument passed for the plot.type='standard' method. A vector of color in the following order : (1) working, (2) stopped, (3:7) 1...5 types of operation, (8:11) numbers, weight, NULL, NULL (if glass eel), (8:11) measured, calculated, expert, direct observation for other taxa. If null will be set to brewer.pal(12,'Paired')[c(8,10,4,6,1,2,3,5,7)] |
color_ope |
Default NULL, argument passed for the plot.type='standard' method. A vector of color for the operations. Default to brewer.pal(4,'Paired') |
silent |
Stops most messages from being displayed |
... |
Additional arguments passed to matplot or plot if plot.type='standard', see ... in fungraph_glasseel and fungraph |
Nothing, called for its side effect of plotting
Cedric Briand [email protected]
calls fungraph
and 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
creates Cumulated graphs for report_mig_mult. Data are summed per day for different dc taxa and stages
Method to overlay graphs for report_mig_mult (multiple dc/taxa/stage in the same plot)
## S4 method for signature 'report_mig,ANY' plot( x, y, plot.type = "standard", color = NULL, color_ope = NULL, silent = FALSE, ... )
## S4 method for signature 'report_mig,ANY' plot( x, y, plot.type = "standard", color = NULL, color_ope = NULL, silent = FALSE, ... )
x |
An object of class report_mig |
y |
From the formals but missing |
plot.type |
One of "standard","step". Defaut to |
color |
Default NULL, argument passed for the plot.type="standard" method. A vector of color in the following order : (1) working, (2) stopped, (3:7) 1...5 types of operation, (8:11) numbers, weight, NULL, NULL (if glass eel), (8:11) measured, calculated, expert, direct observation for other taxa. If null will be set to brewer.pal(12,"Paired")[c(8,10,4,6,1,2,3,5,7)] |
color_ope |
Default NULL, argument passed for the plot.type="standard" method. A vector of color for the operations. Default to brewer.pal(4,"Paired") |
silent |
Stops displaying the messages. |
... |
Additional arguments passed to matplot or plot if plot.type="standard", see ... in fungraph_glasseel and fungraph |
Nothing, called for its side effect
Cedric Briand [email protected]
Plots of various type for reportcarlot
## S4 method for signature 'report_sample_char,missing' plot(x, plot.type = "1", silent = FALSE)
## S4 method for signature 'report_sample_char,missing' plot(x, plot.type = "1", silent = FALSE)
x |
An object of class report_sample_char |
plot.type |
One of '1','violin plot'. Defaut to |
silent |
Stops displaying the messages |
Nothing, called for its side effect, plotting
Cedric Briand [email protected]
Plots of various type for report_sea_age
## S4 method for signature 'report_sea_age,missing' plot(x, plot.type = "1", silent = FALSE)
## S4 method for signature 'report_sea_age,missing' plot(x, plot.type = "1", silent = FALSE)
x |
An object of class report_sea_age-class |
plot.type |
Default "1"
|
silent |
Default FALSE, if TRUE the program should no display messages. |
Nothing, called for its side effect of plotting
Cedric Briand [email protected]
Plots of various type for report_silver_eel
## S4 method for signature 'report_silver_eel,missing' plot(x, plot.type = c("1", "2", "3", "4"), silent = FALSE)
## S4 method for signature 'report_silver_eel,missing' plot(x, plot.type = c("1", "2", "3", "4"), silent = FALSE)
x |
An object of class report_silver_eel-class |
plot.type |
Default "1"
|
silent |
Stops displaying the messages |
A lattice xy.plot if plot.type =1
, a lattice barchart if plot.type=2
, nothing but plots a series of graphs in
a single plot if plot.type=3
, a lattice cloud object if plot.type=4
Cedric Briand [email protected]
Plot method for report_species
## S4 method for signature 'report_species,missing' plot(x, plot.type = "pie", color = NULL, silent = FALSE)
## S4 method for signature 'report_species,missing' plot(x, plot.type = "pie", color = NULL, silent = FALSE)
x |
An object of class report_species-class |
plot.type |
Default pie #'
'
|
color |
Default NULL, a vector of colors of length corresponding to the number of taxa-stage different values, use unique(bilesp@calcdata$taxa_stage) to get that number. The color applies to both pie and barchart plots |
silent |
Stops displaying the messages |
Nothing, called for producing plots
Cedric Briand [email protected]
Method to print the command line of the object.
## S4 method for signature 'report_dc' print(x, ...)
## S4 method for signature 'report_dc' print(x, ...)
x |
An object of class report_dc |
... |
Additional parameters passed to print |
Nothing, called for its side effect
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_df' print(x, ...)
## S4 method for signature 'report_df' print(x, ...)
x |
An object of class report_df |
... |
Additional parameters passed to print |
Nothing, called for its side effect of printing data
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_mig_mult' print(x, ...)
## S4 method for signature 'report_mig_mult' print(x, ...)
x |
An object of class report_mig_mult |
... |
Additional parameters passed to print |
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_mig' print(x, ...)
## S4 method for signature 'report_mig' print(x, ...)
x |
An object of class report_mig |
... |
Additional parameters passed to print |
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_sample_char' print(x, ...)
## S4 method for signature 'report_sample_char' print(x, ...)
x |
An object of class report_sample_char |
... |
Additional parameters passed to print |
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_sea_age' print(x, ...)
## S4 method for signature 'report_sea_age' print(x, ...)
x |
An object of class report_sea_age |
... |
Additional parameters passed to print |
cedric.briand
Method to print the command line of the object
## S4 method for signature 'report_silver_eel' print(x, ...)
## S4 method for signature 'report_silver_eel' print(x, ...)
x |
An object of class report_silver_eel |
... |
Additional parameters passed to print |
NULL, prints data in the console
cedric.briand
The dataset corresponds to the three fishways located on the Arzal dam, filled with annual data
r_ann
r_ann
An object of class report_annual-class with data slot loaded.
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 kindly provided as an example set by the Migradour association.
r_ann_adour
r_ann_adour
An object of class report_annual-class with data slot loaded.
This data corresponds to the data collected at the vertical slot fishway camera from 2000 to 2015. It represents an object of class report_dc-class with data loaded
r_dc
r_dc
An object of class report_dc with 4 slots:
A dataframe with 544 obs. of 7 variables
The number of the DC
Starting time a POSIXct
Ending time a POSIXct
DC id
A comment
Integer 1= working, 0 not working
The type of operation ('1'=normal operation, '2'=Device stopped in normal operation (e.g. the trap is disactivated for the duration of the fish sorting and counting by operators), '3'='Stopped for maintenance or other problem', '4'='Works but not fully operational, i.e. the camera is not working properly because of high turbidity...', '5'='Not known')
label corresponding to per_tar_code
the ref_dc
object with 3 slots filled with data corresponding to the iav postgres schema
the ref_horodate
with horodate set for starting date
the ref_horodate
with horodate set for ending date
This dataset corresponds to the data collected at the vertical slot fishway in 2015, the fishway is working daily with a cycle depending on tide. This dataset is used to show an example of detailed output for an object of class report_df-class with data loaded
r_df
r_df
An object of class report_df with 4 slots:
A dataframe with 4261 obs. of 7 variables
The number of the DF
Starting time a POSIXct
Ending time a POSIXct
DF id
A comment
Integer 1= working, 0 not working
The type of operation ('1'=normal operation, '2'=Device stopped in normal operation (ie lift ascending, high tide...), '3'='Stopped for maintenance or other problem', '4'='Works but not fully operational,i.e.flow problem, flood, clogged with debris...', '5'='Not known')
label corresponding to per_tar_code
the ref_df
object with 3 slots filled with data corresponding to the iav postgres schema
the ref_horodate
with horodate set for starting date
the ref_horodate
with horodate set for ending date
'
The dataset corresponds to the daily temperatures and moon phases in Arzal (Vilaine estuary, France). This environmental station is used to analyze conditions in which fish migrated at Arzal dam
r_env
r_env
An object of class report_env-class with data slot loaded:
the ref_env
object with 5 slots filled with data corresponding to the iav postgres schema
object of class ref_horodate-class
: the start date selected
object of class ref_horodate-class
: the end date selected
A dataframe with 723 rows and 6 variables
start date
end date
method of data collection, measured, calculated...
the value of the parameter if qualitative
the value of the parameter if quantitative
station id
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 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. The weight is called a 'wet weight' as we don't wan't to drain any of the mucus in glass eel when weighting them. Samples of 50 to 200 glass eel are weighted and then counted to provide an idea of the seasonal evolution of wet weight.
r_gew
r_gew
An object of class report_ge_weight
of length 1.
This dataset corresponds to the data collected at the vertical slot fishway in 2012, video recording marine lamprey migration
r_mig
r_mig
An object of class report_mig with 8 slots:
the ref_dc
object with 4 slots filled with data corresponding to the iav postgres schema
the ref_taxa
the taxa selected
the ref_stage
the stage selected
the ref_timestep_daily
calculated for all 2015
A dataframe with 10304 rows and 11 variables
operation id
sample id
sample id
dc id
species id
stage id
the value
either effectif (number) or poids (weights)
destination of the fishes
method of data collection, measured, calculated...
A data frame with 0 observations : no quantity are reported for video recording of mullets, only numbers
A time sequence generated for the report, used internally
The dataset corresponds to the characteristics (qualitative and quantitative) of salmo salar migrating at Decize (Loire river) and Vichy (Allier river) counting device in 2012. It has been loaded as an example for the report_mig_char-class and kindly provided by Loire Grands Migrateurs (LOGRAMI).
r_mig_char
r_mig_char
An object of class report_mig_char-class with data slot loaded:
slot to be filled with the calcule method
A list of 2 elements
values of all the qualitative parameters
values of all the quantitative parameters
the ref_dc
: the control devices selected
the ref_taxa
: Salmo salar selected
the ref_stage
: the stages selected
an object of class ref_par-class: the parameters used
an object of class ref_horodate-class
: the start date selected
an object of class ref_horodate-class
: the end date selected
This dataset corresponds to the data collected in the vertical slot fishway for the video recording operation. It is loaded along with r_mig to demonstrate the use of the report_mig-class when the database is not loaded
r_mig_dc
r_mig_dc
An object of class report_dc-class
This dataset corresponds to the data collected at in the vertical slot fishway it is loaded along with r_mig and used to demonstrate the report_mig-class when the database is not installed.
r_mig_df
r_mig_df
An object of class report_df-class
The dataset correspond to data loaded for the Arzal dam (Vilaine) in 2008, two quantitative parameters (temperature and tide coefficient) and a qualitative parameter (moon phase) are loaded.
r_mig_env
r_mig_env
An object of class report_env-class with data slot loaded:
An object of class report_mig_mult-class
An object of class report_env-class
#'
The first eel trapping ladder in France was built by Antoine Legault and the team from Rennes in the Sevre Niortaise, Marais Poitevin. Also refurbished several times since 1984 it has been operational at the same location and provides one of the longest series of eel migration. For this reason, the dataset has been loaded as an example for the report_mig_interannual-class. It has been kindly provided by the parc du Marais Poitevin. The stage corresponds to small eels (elvers) less than 150 mmm stage name 'PANG'
r_mig_interannual
r_mig_interannual
An object of class report_mig_interannual-class with data loaded.
This data corresponds to the data collected at the Vichy fishway between 1997 and 2012, video recording of the Salmo salar upstream migration. This dataset has been kindly provided by Loire Grands Migrateurs.
r_mig_interannual_vichy
r_mig_interannual_vichy
An object of class report_mig_interannual-class with 7 slots:
the ref_dc
object with 4 slots filled with data corresponding to the iav postgres schema
the ref_taxa
the taxa selected
the ref_stage
the stage selected
the ref_timestep_daily
calculated for all 2015
the ref_timestep_daily
calculated for all 2015
A dataframe with 7138 rows and 10 variables
sample id
dc id
species id
stage id
year
date
method of data collection, measured, calculated...
date with special format for export
organisme provided the data
This data corresponds to data collected from three fishways and correspond to the migration station at Arzal (Vilaine estuary, France) in 2011 for three continental stages of eel (Anguilla anguilla) : glass eel, yellow eel and silver eel.
r_mig_mult
r_mig_mult
An object of class report_mig_mult with slots:
the ref_dc
object filled with data
the ref_taxa
object filled in with data corresponding to dc
the ref_stage
object filled in with data corresponding to dc, and taxa
the ref_timestep_daily
calculated for all 2011
A dataframe with 400 rows and 11 variables
operation id
sample id
sample id
dc id
species id
stage id
the value
either effectif (number) or poids (weights)
destination of the fishes
method of data collection, measured, calculated...
slot to be filled with the calcule method
A data frame with 364 observations with daily coefficients to convert from weight to numbers
A time sequence generated for the report, used internally by the object
This dataset corresponds to data collected at three different control devices. This object is of class report_dc-class with data loaded it is loaded along with r_mig_mult and used in demonstration for the report_mig_mult-class
r_mig_mult_dc
r_mig_mult_dc
An object of class report_dc with 4 slots
A dataframe with 25 rows and 7 variables
the df or dc unique id
the starting date of the counting device operation POSIXct
the ending date of the counting device operation POSIXct
comments on the counting device operation
Boolean, is the counting device working ?
stage id
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.
The label for the type or operation
the ref_dc
the DC with 4 slots
the selected device
the dam
the monitoring station, a section of river
A dataset of all dc present in the database with 10 observations
the beginning date, a ref_horodate-class
the ending date, a ref_horodate-class
This dataset corresponds to the data collected at three different fishways it is loaded along with r_mig_mult and used in demonstration for the report_mig_mult-class
r_mig_mult_df
r_mig_mult_df
An object of class report_df report_df-class
This dataset corresponds to the data collected at three different control devices It is an object of class report_ope-class with data loaded. it is loaded along with r_mig_mult
r_mig_mult_ope
r_mig_mult_ope
An object of class report_ope
This dataset corresponds to the data collected at the vertical slot fishway in Arzal (Vilaine river estuary, France). The operation of the fishway is dependent on tide and is recorded every 10 minutes. This dataset has to be loaded along with r_mig to demonstrate the use of the report_mig-class
r_mig_ope
r_mig_ope
An object of class report_ope
This dataset corresponds to the data collected at two different control devices at the Arzal control station (see example in report_sample_char-class), all body size parameters (total size, size converted from pixel in video control) are used in example
r_sample_char
r_sample_char
An object of class report_sample_char-class
This dataset corresponds to the data collected at Vichy (left and right bank fishways) and Decize-Saint Leger des Vignes fishways (respectively on the Allier and Loire river, France) in 2012 on the size structure of Salmo salar. It has been kindly provided by the Loire Grands Migrateurs (LOGRAMI) association.
r_seaa
r_seaa
An object of class report_sea_age-class with 8 slots:
the ref_dc
: the control devices selected
the ref_taxa
: Salmo salar selected
the ref_stage
: the stages selected
Object of class ref_par-class: the parameters used
object of class ref_horodate-class
: the start date selected
object of class ref_horodate-class
: the end date selected
The size limit, in mm between 1 sea winter fishes and 2 sea winter fishes
The size limit, in mm between 2 sea winter fishes and 3 sea winter fishes
A dataframe with 898 rows and 20 variables
operation id
sample id
dc id
start date
end date
number of fishes
species id
stages id
species latin names
stages names
destination of the fishes id
destination of the fishes names
parameter name
parameter id
method of data collection, measured, calculated...
the value of the parameter
The dataset corresponds to the silver eel traps ('anguilleres) for 2015-2016. This dataset has been kindly provided by the Federation de Peche de la Somme, given the upstream location of the trap, most individuals are female
r_silver
r_silver
An object of class report_silver_eel-class with data slot loaded.
ref_choice referential class allows to choose within several values with radiobuttons interface
listechoice
A character vector giving possible choices
label
A character, title of the box giving the possible choices
selected
An Integer
the initial selected value (as an index), first=1 used in gradio
Objects can be created by calls of the form
new('ref_choice', listechoice=character() ,label=character()
,selected=integer())
.
Other referential objects:
charge,ref_choice-method
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Enables to load conversion coefficients quantity-number. This class only exists to load the data with its method charge. It is not used directly as component of the graphical interface, as the year is already loaded in the different report objects
data
A data.frame
datedebut
A 'POSIXlt'
datefin
A 'POSIXlt'
Objects can be created by calls of the form
new('ref_coe')
.
Class loading coefficient of conversion between quantity (weights or volumes of glass eel) and numbers between a starting and finishing date
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Description of a control device.
dc_selected
Object of class 'integer'
, The selected device
ouvrage
Object of class 'integer'
, the attached dam
station
Object of class 'character'
, the attached migration monitoring station, this is necessary to join the
table of escapements calculated at the station level.
data
Object of class 'data.frame'
data pertaining to the control device
Objects can be created by calls of the form
new('ref_dc', dc_selected=integer(), ouvrage=integer(),
data=data.frame())
.
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Representation of a fishway, contains description data of all fishways from
the database along with the selected fishways (df) (integer)
Objects from the Class: Objects can be created by calls of the form
new('ref_df', df_selected=integer(), ouvrage=integer(),
data=data.frame())
.
df_selected |
Object of class |
ouvrage |
Object of class |
data |
Object of class |
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Enables to load measure stations and to select one of them
dataframe
Data concerning the measure station
env_selected
The selected measure station
Objects can be created by calls of the form
new('ref_env', ...)
.
choice of date with method to show current and previous year
horodate
a "POSIXt"
Objects can be created by calls of the form
new("ref_horodate", ...{})
.
Cedric Briand [email protected]
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Class enabling to load the list of parameters and select one of them
data
A data.frame
par_selected
A character vector corresponding to par_code
data='data.frame'
the list of parameters
Objects can be created by calls of the form
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Class enabling to load the list of qualitative parameters and to select one of them. It inherits from 'ref_par', uses its 'choice' method
valqual='data.frame'
the list of qualitative parameters
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Class enabling to load the list of quantitative parameters and to select one of them. It inherits from 'ref_par', uses its 'choice' method
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_stage-class
,
ref_taxa-class
,
ref_year-class
Representation of a fish phase
data
A data frame containing data loaded from the database by either charge or charge_with_filter methods
stage_selected
Contains the code 'tax_code'
of the stage selected by choice_c() method
Objects can be created by calls of the form
new('ref_stage', data='data.frame')
.
Object of class 'data.frame'
~ The phases
available in the database
Object of class 'data.frame'
~ The
phases available in the database
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_taxa-class
,
ref_year-class
Loading and selection of fish species. This class is a referential class, and it is integrated into refreport objects.
data
A 'data.frame'
of species available in the database
taxa_selected
Contains the code 'tax_code'
of the taxa selected by choice_c() method
Objects can be created by calls of the form
new('ref_taxa', ...)
.
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_year-class
allows to a put a value within a glabel
title='character'
the title of the box giving the possible choices
labels
the logical parameters choice
checked
a vector
Representation of a ref_timestep object with a step length equal to one day. It receives an inheritance from ref_timestep
validity_ref_timestep_daily
Objects can be created by calls of the form
new('ref_timestep_daily',
dateDebut='POSIXt',step_duration=numeric(),nb_step=numeric(),nocurrent_step=integer())
.
Object of class 'POSIXt'
Starting
date
Object of class 'POSIXt'
Starting date
Object of class 'numeric'
Step length
Object of class 'numeric'
Step length
Object of class 'numeric'
Number of steps
Object of class 'numeric'
Number of steps
Object of class 'integer'
Number of the
current step
Object of class 'integer'
Number of the
current step
Describes a time step
Objects can be created by calls of the form
new("ref_timestep",
dateDebut="POSIXt",step_duration=numeric(),nb_step=numeric(),nocurrent_step=integer())
.
Object of class "POSIXt"
Starting
date
Object of class "POSIXt"
Starting date
Object of class "numeric"
Step length
Object of class "numeric"
Step length
Object of class "numeric"
Number of steps
Object of class "numeric"
Number of steps
Object of class "integer"
Number of the
current step
Object of class "integer"
Number of the
current step
Character to represent a ref_timestep
Objects can be created by calls of the form
new("ref_timestepChar", ...{})
showClass("ref_timestepChar")
showClass("ref_timestepChar")
Class used to select one or several years
data
A data.frame
with the list of possible years selected as numerics
year_selected
A numeric vector
Objects can be created by calls of the form
new("ref_year", data=data.frame(), year_selected=numeric())
.
Other referential objects:
charge,ref_choice-method
,
ref_choice-class
,
ref_coe-class
,
ref_dc-class
,
ref_df-class
,
ref_horodate-class
,
ref_list-class
,
ref_par-class
,
ref_parqual-class
,
ref_parquan-class
,
ref_stage-class
,
ref_taxa-class
This class displays annual migration counts, for several counting device, taxa or stages.
dc
Object of class ref_dc-class
, the counting device, multiple values allowed
data
Object of class "data.frame"
data for report lot
taxa
An object of class ref_taxa-class
, multiple values allowed
stage
An object of class ref_stage-class
, multiple values allowed
start_year
Object of class ref_year-class
. ref_year allows to choose year of beginning
end_year
Object of class ref_year-class
ref_year allows to choose last year of the report
Cedric Briand [email protected]
Other report Objects:
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
# launching stacomi without database for demo stacomi(database_expected=FALSE) # the following piece of script will load the Arzal dataset and connected to iav postgres schema # it requires a working database # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_ann<-new("report_annual") r_ann<-choice_c(r_ann, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGJ","AGG"), start_year="1996", end_year="2015", silent=FALSE) r_ann<-connect(r_ann) ## End(Not run) # the following dataset has been generated by the previous code data(r_ann) xtr_ann<-stacomiR::xtable(r_ann, dc_name=c("Passe bassins","Piege anguille RG","Piege anguille RD"), tax_name="Anguille", std_name=c("Arg.","Jaun.")) # below not run but one can create a file as following ## Not run: path=file.path(path.expand(get("datawd",envir=envir_stacomi)), paste(paste(r_ann@dc@dc_selected,collapse="+"),"_", paste(r_ann@taxa@taxa_selected,collapse="+"),"_", paste(r_ann@stage@stage_selected,collapse="+"),"_", r_ann@start_year@year_selected,":", r_ann@end_year@year_selected,".html",sep=""),fsep ="/") # here you can add an argument file=path print(xtr_ann,type="html") # the following uses the "addtorow" argument which creates nice column headings, # format.args creates a thousand separator # again this will need to be saved in a file using the file argument print(xtr_ann, add.to.row=get("addtorow",envir_stacomi), include.rownames = TRUE, include.colnames = FALSE, format.args = list(big.mark = " ", decimal.mark = ",") ) # barplot transforms the data, further arguments can be passed as to barplot barplot(r_ann) barplot(r_ann, args.legend=list(x="topleft",bty = "n"), col=c("#CA003E","#1A9266","#E10168","#005327","#FF9194")) # An example with custom arguments for legend.text (overriding plot defauts) data(r_ann_adour) if (requireNamespace("RColorBrewer", quietly = TRUE)){ lesdc<-r_ann_adour@dc@data$dc_code[r_ann_adour@dc@data$dc%in%r_ann_adour@dc@dc_selected] barplot(r_ann_adour, legend.text=lesdc, args.legend=list(x="topleft",bty = "n"), col=RColorBrewer::brewer.pal(9,"Spectral"), beside=TRUE) } plot(r_ann_adour) ## End(Not run)
# launching stacomi without database for demo stacomi(database_expected=FALSE) # the following piece of script will load the Arzal dataset and connected to iav postgres schema # it requires a working database # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_ann<-new("report_annual") r_ann<-choice_c(r_ann, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGJ","AGG"), start_year="1996", end_year="2015", silent=FALSE) r_ann<-connect(r_ann) ## End(Not run) # the following dataset has been generated by the previous code data(r_ann) xtr_ann<-stacomiR::xtable(r_ann, dc_name=c("Passe bassins","Piege anguille RG","Piege anguille RD"), tax_name="Anguille", std_name=c("Arg.","Jaun.")) # below not run but one can create a file as following ## Not run: path=file.path(path.expand(get("datawd",envir=envir_stacomi)), paste(paste(r_ann@dc@dc_selected,collapse="+"),"_", paste(r_ann@taxa@taxa_selected,collapse="+"),"_", paste(r_ann@stage@stage_selected,collapse="+"),"_", r_ann@start_year@year_selected,":", r_ann@end_year@year_selected,".html",sep=""),fsep ="/") # here you can add an argument file=path print(xtr_ann,type="html") # the following uses the "addtorow" argument which creates nice column headings, # format.args creates a thousand separator # again this will need to be saved in a file using the file argument print(xtr_ann, add.to.row=get("addtorow",envir_stacomi), include.rownames = TRUE, include.colnames = FALSE, format.args = list(big.mark = " ", decimal.mark = ",") ) # barplot transforms the data, further arguments can be passed as to barplot barplot(r_ann) barplot(r_ann, args.legend=list(x="topleft",bty = "n"), col=c("#CA003E","#1A9266","#E10168","#005327","#FF9194")) # An example with custom arguments for legend.text (overriding plot defauts) data(r_ann_adour) if (requireNamespace("RColorBrewer", quietly = TRUE)){ lesdc<-r_ann_adour@dc@data$dc_code[r_ann_adour@dc@data$dc%in%r_ann_adour@dc@dc_selected] barplot(r_ann_adour, legend.text=lesdc, args.legend=list(x="topleft",bty = "n"), col=RColorBrewer::brewer.pal(9,"Spectral"), beside=TRUE) } plot(r_ann_adour) ## End(Not run)
The counting device is not always working. It may me stopped either following a monitoring protocol, or due to malfunction of the device, this class allows to draw graphics allowing an overview of the device operation
data
A data frame
dc
An object of class ref_dc-class
horodatedebut
An object of class ref_horodate-class
horodatefin
An object of class ref_horodate-class
Objects can be created by calls of the form
new("report_dc", ...)
.
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
# An example that will work only if the database is present # and the program installed and comprises the schema iav # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.password = password ) } stacomi(TRUE,sch="iav") r_dc=new("report_dc") r_dc<-choice_c(r_dc, 5, horodatedebut="2000-01-01", horodatefin="2015-12-31", silent=TRUE) r_dc<-connect(r_dc) ## # this dataset has been loaded by the previous lines ########################################################### # Without connexion to the database (use dataset r_dc) ########################################################## # this option allows to launch the program without the interface to display # some of the program features. stacomi(database_expected=FALSE) data("r_dc") plot(r_dc,plot.type="1") plot(r_dc,plot.type="2") plot(r_dc,plot.type="3",main="trial title") plot(r_dc,plot.type="4",main="trial title") # the following will write in the datawd folder summary(r_dc) ## End(Not run)
# An example that will work only if the database is present # and the program installed and comprises the schema iav # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.password = password ) } stacomi(TRUE,sch="iav") r_dc=new("report_dc") r_dc<-choice_c(r_dc, 5, horodatedebut="2000-01-01", horodatefin="2015-12-31", silent=TRUE) r_dc<-connect(r_dc) ## # this dataset has been loaded by the previous lines ########################################################### # Without connexion to the database (use dataset r_dc) ########################################################## # this option allows to launch the program without the interface to display # some of the program features. stacomi(database_expected=FALSE) data("r_dc") plot(r_dc,plot.type="1") plot(r_dc,plot.type="2") plot(r_dc,plot.type="3",main="trial title") plot(r_dc,plot.type="4",main="trial title") # the following will write in the datawd folder summary(r_dc) ## End(Not run)
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 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, "2"=Device stopped in normal operation (ie lift ascending, high tide...), "3"="Stopped for maintenance or other problem", "4"="Works but not fully operational,i.e.flow problem, flood, clogged with debris...", "5"="Not known")
data
A data frame
df
An object of class ref_df-class
horodatedebut
An object of class ref_horodate-class
horodatefin
An object of class ref_horodate-class
Objects can be created by calls of the form
new("report_df")
.
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
stacomi( database_expected=FALSE) # An example that will work with the database installed only and schema iav in the database # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_df=new("report_df") r_df<-choice_c(r_df, 1, horodatedebut="2015-01-01", 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 r_df<-connect(r_df) ## End(Not run) data("r_df") plot(r_df,plot.type="4") # the following examples work but take a while to compute ## Not run: plot(r_df,plot.type="1") plot(r_df,plot.type="2",main="A nice title") plot(r_df,plot.type="3",main="A nice title") ## End(Not run)
stacomi( database_expected=FALSE) # An example that will work with the database installed only and schema iav in the database # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_df=new("report_df") r_df<-choice_c(r_df, 1, horodatedebut="2015-01-01", 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 r_df<-connect(r_df) ## End(Not run) data("r_df") plot(r_df,plot.type="4") # the following examples work but take a while to compute ## Not run: plot(r_df,plot.type="1") plot(r_df,plot.type="2",main="A nice title") plot(r_df,plot.type="3",main="A nice title") ## End(Not run)
Annual overview of environmental conditions. This class enables to draw some plot, but will mostly used to build joined graphs crossing the information from report_mig_mult-class and report_mig_env-class
horodatedebut
horodatefin
stationMesure
data
data.frame
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
stacomi( database_expected=FALSE) ## Not run: if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_env<-new("report_env") r_env<-choice_c(r_env, stationMesure=c("temp_gabion","coef_maree"), datedebut="2008-01-01", datefin="2008-12-31", silent=FALSE) r_env<-connect(r_env) ## End(Not run) data("r_env") plot(r_env,silent=TRUE)
stacomi( database_expected=FALSE) ## Not run: if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_env<-new("report_env") r_env<-choice_c(r_env, stationMesure=c("temp_gabion","coef_maree"), datedebut="2008-01-01", datefin="2008-12-31", silent=FALSE) r_env<-connect(r_env) ## End(Not run) data("r_env") plot(r_env,silent=TRUE)
In trapping ladders, glass eel are seldom counted, as they are too tiny to handle and too numerous to count. 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 to manually test more complex models. Some plots are provided to display the coefficients stored in the database, and the model results. A parameter provided in the graphical interface or in the command line (slot liste) takes values '1', '>1', 'tous' which mean respectively use only individual sample of glass eels, or use 'group weights' which can be more close to the real weight of glass eel during counts as glass eel are not completely drained from their water during handling to preserve their mucus. The list choice 'tous' means that both individual and group weights are selected.
data
A 'data.frame'
data for report lot
calcdata
A list containing two processed data frames, data and coe
dc
Object of class ref_dc-class
, the counting device
start_year
Object of class ref_year-class
. ref_year allows to choose the year of beginning
end_year
Object of class ref_year-class
ref_year allows to choose last year of the report
coe
Object of class ref_coe-class
class loading coefficient
of conversion between quantity (weights or volumes of glass eel) and numbers
liste
Object of class ref_list-class
ref_list referential
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.
In this class some tools are available to import glass eel measurement from experimental fishing in the estuary. For the charge method dates for the request are from august to august (a glass eel season)
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
require(stacomiR) # launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE, sch='iav') # this requires a working database with the schema iav # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_gew<-new("report_ge_weight") r_gew@liste<-charge(object=r_gew@liste,listechoice=c("=1",">1","tous"),label="") # here I'm using weights when number are larger than 1i.e.wet weight # always choose a date from one year to the next eg 2010 to 2011 # as the dates are from august to august r_gew<-choice_c(r_gew, dc=c(6), start_year="2009", end_year="2015", selectedvalue=">1", silent=FALSE) r_gew<-connect(r_gew) r_gew<-calcule(r_gew) ## End(Not run) # load the dataset generated by previous lines data("r_gew") # the calculation will fill the slot calcdata # A ggplot showing the trend in weight plot(r_gew, plot.type=1) # A plot showing both the data and the trend as recorded in the database plot(r_gew, plot.type=2) # Same as plot.type=1 but with size according to size of the sample, # usefull for wet weights where weight are recorded on a number of glass eel plot(r_gew, plot.type=3) ## Not run: # First model with nls, see Guerault and Desaunay (1993) model(r_gew,model.type="seasonal") model(r_gew,model.type="seasonal1") ## End(Not run)
require(stacomiR) # launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE, sch='iav') # this requires a working database with the schema iav # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE, sch='iav') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_gew<-new("report_ge_weight") r_gew@liste<-charge(object=r_gew@liste,listechoice=c("=1",">1","tous"),label="") # here I'm using weights when number are larger than 1i.e.wet weight # always choose a date from one year to the next eg 2010 to 2011 # as the dates are from august to august r_gew<-choice_c(r_gew, dc=c(6), start_year="2009", end_year="2015", selectedvalue=">1", silent=FALSE) r_gew<-connect(r_gew) r_gew<-calcule(r_gew) ## End(Not run) # load the dataset generated by previous lines data("r_gew") # the calculation will fill the slot calcdata # A ggplot showing the trend in weight plot(r_gew, plot.type=1) # A plot showing both the data and the trend as recorded in the database plot(r_gew, plot.type=2) # Same as plot.type=1 but with size according to size of the sample, # usefull for wet weights where weight are recorded on a number of glass eel plot(r_gew, plot.type=3) ## Not run: # First model with nls, see Guerault and Desaunay (1993) model(r_gew,model.type="seasonal") model(r_gew,model.type="seasonal1") ## End(Not run)
Migration along with qualitative or quantitative characteristics or both (e.g.) weight of eels according to the size class per period of time, weight 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 report_mig and report_mig_mult the whole time span of the migration operation is not considered, only the date of beginning of the operation is used to perform calculations.
calcdata
A 'list' of calculated data, filled in by the calcule method
data
A data.frame
inherited from report_sample_char-class
dc
An object of class ref_dc-class inherited from report_sample_char-class
taxa
An object of class ref_taxa-class inherited from report_sample_char-class
stage
An object of class ref_stage-class inherited from report_sample_char-class
horodatedebut
An object of class ref_horodate-class inherited from report_sample_char-class
horodatefin
An object of class ref_horodate-class inherited from report_sample_char-class
par
An object of class ref_par-class inherited from report_sample_char-class
echantillon
An object of class ref_choice-class, vector of choice
parquan
An object of class ref_parquan-class, quantitative parameter
parqual
An object of class ref_parqual-class, qualitative parameter
Objects can be created by calls of the form
new('report_mig_char', ...)
. they are loaded by the interface
using interface_report_mig_char function.
The main difference between this class and report_sample_char-class is that this class allows to select (or not) the samples, and that it handles quantitative and qualitative parameters separately.
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
require(stacomiR) stacomi( database_expected=FALSE, sch='logrami') # this requires a database with the schema logrami # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch='logrami') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_mig_char <- new("report_mig_char") # here parqual is not in the list # so this is equivalent to parqual=NULL # default for echantillon is "with" r_mig_char <- choice_c(r_mig_char, dc=c(107,108,101), taxa=c("Salmo salar"), stage=c('5','11','BEC','BER','IND'), parquan=c('C001','1786','1785'), horodatedebut="2012-01-01", horodatefin="2012-12-31", silent=FALSE) # r_mig_char<-charge(r_mig_char) not necessary there r_mig_char <- connect(r_mig_char) ## End(Not run) # load the dataset generated by previous lines data("r_mig_char") r_mig_char<-calcule(r_mig_char, silent=TRUE) plot(r_mig_char,plot.type="quant", silent=TRUE) # one quantitative parameter found, manual choice of color plot(r_mig_char,plot.type="quant",color_parm=c("C001"="red"), silent=TRUE) # age will be plotted as a qualitative variable # here we split size data accoding to the limit known between different ages from # scale reading in the Loire r_mig_char <- setasqualitative(r_mig_char,par='C001', breaks=c(0,675,850,2000), labels=c("age 1","age 2","age 3")) r_mig_char<-calcule(r_mig_char, silent=TRUE) plot(r_mig_char, plot.type="qual", silent=TRUE) plot(r_mig_char, plot.type="crossed") plot(r_mig_char, plot.type="crossed", color_parm=c("age 1"="#379ec6","age 2"="#173957","age 3"="#b09953")) xt<-xtable(r_mig_char) # use method print.xtable to get the output
require(stacomiR) stacomi( database_expected=FALSE, sch='logrami') # this requires a database with the schema logrami # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch='logrami') if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_mig_char <- new("report_mig_char") # here parqual is not in the list # so this is equivalent to parqual=NULL # default for echantillon is "with" r_mig_char <- choice_c(r_mig_char, dc=c(107,108,101), taxa=c("Salmo salar"), stage=c('5','11','BEC','BER','IND'), parquan=c('C001','1786','1785'), horodatedebut="2012-01-01", horodatefin="2012-12-31", silent=FALSE) # r_mig_char<-charge(r_mig_char) not necessary there r_mig_char <- connect(r_mig_char) ## End(Not run) # load the dataset generated by previous lines data("r_mig_char") r_mig_char<-calcule(r_mig_char, silent=TRUE) plot(r_mig_char,plot.type="quant", silent=TRUE) # one quantitative parameter found, manual choice of color plot(r_mig_char,plot.type="quant",color_parm=c("C001"="red"), silent=TRUE) # age will be plotted as a qualitative variable # here we split size data accoding to the limit known between different ages from # scale reading in the Loire r_mig_char <- setasqualitative(r_mig_char,par='C001', breaks=c(0,675,850,2000), labels=c("age 1","age 2","age 3")) r_mig_char<-calcule(r_mig_char, silent=TRUE) plot(r_mig_char, plot.type="qual", silent=TRUE) plot(r_mig_char, plot.type="crossed") plot(r_mig_char, plot.type="crossed", color_parm=c("age 1"="#379ec6","age 2"="#173957","age 3"="#b09953")) xt<-xtable(r_mig_char) # use method print.xtable to get the output
Enables to compute an annual overview of fish migration and environmental conditions in the same chart. Environmental conditions may trigger migration events, variation in flow or temperatures can be plotted along migration to check graphically for a possible relation. To enable this, environmental conditions are loaded from an "environmental monitoring station", which records environmental parameters and is attached to a migratory station in the database. This class enables both continuous output (temperature -flow) as well as discrete parameters (qualitative = moon phase, type of operation of a gate, opening of a gate...) which will be displayed on the graph. Values are scaled so that single plot can display migration numbers and environmental parameters. Environmental parameters when stored at a time scale lower that a day are averaged per day, unless they are qualitative parameters, in which case only the first event of the day is displayed on the annual plot.
report_mig_mult
report_env
[email protected] [email protected]
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
require(stacomiR) stacomi( database_expected=FALSE) # the following will load the data provided the user has access to the database # with data in the iav example scheme. # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_mig_env<-new("report_mig_env") r_mig_env<-choice_c(r_mig_env, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGJ","AGG","CIV"), stationMesure=c("temp_gabion","coef_maree","phases_lune"), datedebut="2008-01-01", datefin="2008-12-31", silent=FALSE) r_mig_env<-charge(r_mig_env) # this is necessary to load operations, DF and DC r_mig_env<-connect(r_mig_env) r_mig_env<-calcule(r_mig_env,silent=TRUE) ## End(Not run) data("r_mig_env") # An example of plot with custom colors. plot(r_mig_env, color_station=c("temp_gabion"="red","coef_maree"="blue","phases_lune"="pink"), color_dc=c("5"="yellow","6"="orange","12"="purple") )
require(stacomiR) stacomi( database_expected=FALSE) # the following will load the data provided the user has access to the database # with data in the iav example scheme. # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) r_mig_env<-new("report_mig_env") r_mig_env<-choice_c(r_mig_env, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGJ","AGG","CIV"), stationMesure=c("temp_gabion","coef_maree","phases_lune"), datedebut="2008-01-01", datefin="2008-12-31", silent=FALSE) r_mig_env<-charge(r_mig_env) # this is necessary to load operations, DF and DC r_mig_env<-connect(r_mig_env) r_mig_env<-calcule(r_mig_env,silent=TRUE) ## End(Not run) data("r_mig_env") # An example of plot with custom colors. plot(r_mig_env, color_station=c("temp_gabion"="red","coef_maree"="blue","phases_lune"="pink"), color_dc=c("5"="yellow","6"="orange","12"="purple") )
When daily report are written in the t_reportjournalier_bjo table by the report_mig-class they can be used by this class to display interannual comparisons of migration. When running its connect method, this class will run the report_mig-class for each year where data are missing, or where the annual sum in the t_reportjournalier_bjo table differs from the counts generated by the report_annual-class : rows have been changed in the database. Different charts are produced with different period grouping. See write_database,report_mig-method for details about how this method inserts data in the t_reportjournalier_bjo table.
dc
An object of class ref_dc-class, the counting device
data
A data.frame
data loaded from the daily migration table t_bilanmigrationjournalier_bjo
taxa
An object of class ref_taxa-class, there can only be one taxa
stage
An object of class ref_stage-class, there can only be one stage
start_year
An object of class ref_year-class. ref_year allows to choose year of beginning
end_year
An object of class ref_year-class ref_year allows to choose last year of the report
calcdata
A list
of calculated data, filled in by the calcule method
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
require(stacomiR) # launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE, sch='pmp') # If you have connection to the database with the pmp scheme # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch="pmp") if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) # (longest historical dataset available # in France for eel ...) this suppose you have access to the pmp schema... # a glimpse of the dataset is still available in the r_mig_interannual dataset # loaded in the package... r_mig_interannual <- new("report_mig_interannual") r_mig_interannual <- choice_c(r_mig_interannual, dc=c(16), taxa=c("Anguilla anguilla"), stage=c("PANG"), start_year="1990", end_year="2015", year_choice=NULL, silent=TRUE) r_mig_interannual <- charge(r_mig_interannual) r_mig_interannual <- connect(r_mig_interannual, check=TRUE) r_mig_interannual <- calcule(r_mig_interannual, silent=TRUE) ## End(Not run) #############otherwise use this ###################### # load the dataset generated by previous lines data("r_mig_interannual") ####################################################### # 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(r_mig_interannual,plot.type="line", year_choice=2015, silent=TRUE) # 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(r_mig_interannual,plot.type="density",year_choice=2015, silent=TRUE) ## Not run: if (requireNamespace("ggplot2", quietly = TRUE)& requireNamespace("viridis", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) g+ ggplot2::scale_fill_manual(values=viridis::viridis(22))+ ggplot2::ggtitle("Saisonnalite de la migration aux Enfrenaux") } ############################################# # the standard plot is showing daily values ########################################### plot(r_mig_interannual,plot.type="standard",year_choice=2015,silent=TRUE) # Manual edition of the graph produced if (requireNamespace("ggplot2", quietly = TRUE)){ g1<-get("g1",envir=envir_stacomi) g1<-g1+ggplot2::ggtitle("Les Enfrenaux")+ ggplot2::scale_fill_manual(name="Source", values=c("purple","#0A0C01"), labels = c("historical set","2015 values"))+ ggplot2::scale_colour_manual(name="Source", values="#B8EA00", labels = c("historical mean")) + ggplot2::ylab("Nombre d'anguilles") print(g1) } ######################################################### # 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<-fun_date_extraction(r_mig_interannual@data, # data to import "bjo_jour", # name of the column where dates are found annee=FALSE, mois=TRUE, semaine =TRUE, jour_mois=FALSE) # sum per month res<-dplyr::select(dat,bjo_valeur,bjo_annee,semaine) res<-dplyr::group_by(res,bjo_annee,semaine) res<-dplyr::summarize(res,effectif=sum(bjo_valeur)) ggplot2::ggplot(res, ggplot2::aes(x = semaine, y = bjo_annee,fill=effectif)) + ggplot2::geom_tile(colour="black") + ggplot2::coord_fixed() + viridis::scale_fill_viridis(begin=0,option="D") + ggplot2::theme_bw()+ ggplot2::theme(panel.background= ggplot2::element_rect(fill = "#9360A9"), panel.grid.major=ggplot2::element_line(colour="#C1DB39"), panel.grid.minor=ggplot2::element_line(colour="#7DD632"))+ ggplot2::ylab("year")+ggplot2::xlab("week")+ 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 report ################################################ # available arguments for timesplit are "quinzaine" and "mois" and "semaine" # 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(r_mig_interannual,plot.type="barchart",timesplit="quinzaine",year_choice=2015,silent=TRUE) # Comparison with historical values. Each year and 2 weeks values # is a point on the graph... plot(r_mig_interannual,plot.type="pointrange",timesplit="mois",year_choice=2015,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(r_mig_interannual,plot.type="step",year_choice=2015,silent=TRUE) if (requireNamespace("ggplot2", quietly = TRUE)& requireNamespace("viridis", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) + ggplot2::theme_minimal() g+viridis::scale_color_viridis(discrete=TRUE)+ ggplot2::ggtitle("Cumulated migration step plot at les Enfrenaux eel trap") } ############################################### # Plots for seasonality of the salmon migration # using a Loire river dataset (Vichy fishway) ################################################ data("r_mig_interannual_vichy") # the following show how data are processed to get # statistics for seaonal migration, daily values r_mig_interannual_vichy<-calcule(r_mig_interannual_vichy, timesplit="jour",year_choice=2012,silent=TRUE) #r_mig_interannual_vichy@calcdata #check this to see the results # statistics for seaonal migration, weekly values r_mig_interannual_vichy<-calcule(r_mig_interannual_vichy,timesplit="semaine" ,year_choice=2012,silent=TRUE) #r_mig_interannual_vichy@calcdata # the plot method also runs the calcule method plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="semaine", year_choice=2012, silent=TRUE) plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="mois", year_choice=2012, silent=TRUE) plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="jour",year_choice=2012, silent=TRUE) ############################################### # 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 stacomi(database_expected = TRUE, sch = 'logrami') bmi_des<-new("report_mig_interannual") bmi_des<-choice_c(bmi_des, dc=c(23), taxa=c("Petromyzon marinus"), stage=c("5"), start_year="2007", end_year="2014", silent=TRUE) bmi_des<-connect(bmi_des) bmi_des<-calcule(bmi_des,timesplit="semaine") plot(bmi_des,plot.type="seasonal",timesplit="semaine",year_choice=2014) plot(bmi_des,plot.type="seasonal",timesplit="jour",year_choice=2014) plot(bmi_des,plot.type="seasonal",timesplit="mois",year_choice=2014) ## End(Not run)
require(stacomiR) # launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE, sch='pmp') # If you have connection to the database with the pmp scheme # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi(database_expected=TRUE, sch="pmp") if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) # (longest historical dataset available # in France for eel ...) this suppose you have access to the pmp schema... # a glimpse of the dataset is still available in the r_mig_interannual dataset # loaded in the package... r_mig_interannual <- new("report_mig_interannual") r_mig_interannual <- choice_c(r_mig_interannual, dc=c(16), taxa=c("Anguilla anguilla"), stage=c("PANG"), start_year="1990", end_year="2015", year_choice=NULL, silent=TRUE) r_mig_interannual <- charge(r_mig_interannual) r_mig_interannual <- connect(r_mig_interannual, check=TRUE) r_mig_interannual <- calcule(r_mig_interannual, silent=TRUE) ## End(Not run) #############otherwise use this ###################### # load the dataset generated by previous lines data("r_mig_interannual") ####################################################### # 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(r_mig_interannual,plot.type="line", year_choice=2015, silent=TRUE) # 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(r_mig_interannual,plot.type="density",year_choice=2015, silent=TRUE) ## Not run: if (requireNamespace("ggplot2", quietly = TRUE)& requireNamespace("viridis", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) g+ ggplot2::scale_fill_manual(values=viridis::viridis(22))+ ggplot2::ggtitle("Saisonnalite de la migration aux Enfrenaux") } ############################################# # the standard plot is showing daily values ########################################### plot(r_mig_interannual,plot.type="standard",year_choice=2015,silent=TRUE) # Manual edition of the graph produced if (requireNamespace("ggplot2", quietly = TRUE)){ g1<-get("g1",envir=envir_stacomi) g1<-g1+ggplot2::ggtitle("Les Enfrenaux")+ ggplot2::scale_fill_manual(name="Source", values=c("purple","#0A0C01"), labels = c("historical set","2015 values"))+ ggplot2::scale_colour_manual(name="Source", values="#B8EA00", labels = c("historical mean")) + ggplot2::ylab("Nombre d'anguilles") print(g1) } ######################################################### # 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<-fun_date_extraction(r_mig_interannual@data, # data to import "bjo_jour", # name of the column where dates are found annee=FALSE, mois=TRUE, semaine =TRUE, jour_mois=FALSE) # sum per month res<-dplyr::select(dat,bjo_valeur,bjo_annee,semaine) res<-dplyr::group_by(res,bjo_annee,semaine) res<-dplyr::summarize(res,effectif=sum(bjo_valeur)) ggplot2::ggplot(res, ggplot2::aes(x = semaine, y = bjo_annee,fill=effectif)) + ggplot2::geom_tile(colour="black") + ggplot2::coord_fixed() + viridis::scale_fill_viridis(begin=0,option="D") + ggplot2::theme_bw()+ ggplot2::theme(panel.background= ggplot2::element_rect(fill = "#9360A9"), panel.grid.major=ggplot2::element_line(colour="#C1DB39"), panel.grid.minor=ggplot2::element_line(colour="#7DD632"))+ ggplot2::ylab("year")+ggplot2::xlab("week")+ 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 report ################################################ # available arguments for timesplit are "quinzaine" and "mois" and "semaine" # 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(r_mig_interannual,plot.type="barchart",timesplit="quinzaine",year_choice=2015,silent=TRUE) # Comparison with historical values. Each year and 2 weeks values # is a point on the graph... plot(r_mig_interannual,plot.type="pointrange",timesplit="mois",year_choice=2015,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(r_mig_interannual,plot.type="step",year_choice=2015,silent=TRUE) if (requireNamespace("ggplot2", quietly = TRUE)& requireNamespace("viridis", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) + ggplot2::theme_minimal() g+viridis::scale_color_viridis(discrete=TRUE)+ ggplot2::ggtitle("Cumulated migration step plot at les Enfrenaux eel trap") } ############################################### # Plots for seasonality of the salmon migration # using a Loire river dataset (Vichy fishway) ################################################ data("r_mig_interannual_vichy") # the following show how data are processed to get # statistics for seaonal migration, daily values r_mig_interannual_vichy<-calcule(r_mig_interannual_vichy, timesplit="jour",year_choice=2012,silent=TRUE) #r_mig_interannual_vichy@calcdata #check this to see the results # statistics for seaonal migration, weekly values r_mig_interannual_vichy<-calcule(r_mig_interannual_vichy,timesplit="semaine" ,year_choice=2012,silent=TRUE) #r_mig_interannual_vichy@calcdata # the plot method also runs the calcule method plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="semaine", year_choice=2012, silent=TRUE) plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="mois", year_choice=2012, silent=TRUE) plot(r_mig_interannual_vichy,plot.type="seasonal", timesplit="jour",year_choice=2012, silent=TRUE) ############################################### # 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 stacomi(database_expected = TRUE, sch = 'logrami') bmi_des<-new("report_mig_interannual") bmi_des<-choice_c(bmi_des, dc=c(23), taxa=c("Petromyzon marinus"), stage=c("5"), start_year="2007", end_year="2014", silent=TRUE) bmi_des<-connect(bmi_des) bmi_des<-calcule(bmi_des,timesplit="semaine") plot(bmi_des,plot.type="seasonal",timesplit="semaine",year_choice=2014) plot(bmi_des,plot.type="seasonal",timesplit="jour",year_choice=2014) plot(bmi_des,plot.type="seasonal",timesplit="mois",year_choice=2014) ## End(Not run)
Migration counts for several Fish counting devices (DC), several taxa and several stages. This migration count can be built either by the graphical interface or from the command line (see examples).
dc
An object of class ref_dc-class
taxa
An object of class ref_taxa-class
stage
An object of class ref_stage-class
timestep
An object of class ref_timestep_daily-class
data
A data.frame containing raw data filled by the connect method
calcdata
A 'list' of calculated daily data, one per dc, filled in by the calcule method
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.
time.sequence
A POSIXt time sequence
A Migration report comes from a migration monitoring : the fishes are monitored in a section of river, this section is called a control station (station). Most often, there is a dam, one or several fishways (DF) which comprise one or several counting devices (DC). On each counting device, the migration is recorded. It can be either an instant recording (video control) or the use of traps, Operations are monitoring operations during a period. For each operation, several species of fishes can be recorded (samples). In the case of migratory fishes the stage of development is important as it may indicate generic migrations, to and fro, between the river and the sea.
Hence a Multiple Migration report is built from several one or several counting devices (DC), one or several Taxa (Taxon), one or several stages (stage). The migration can be also recorded not as numbers, but in the case of glass eels, as weight, which will be later transformed to number, from daily conversion coefficients. The methods in this class test whether the counts are numbers or another type of quantity. This class makes different calculations than report_mig, it does not handle escapement coefficients, it uses quantities other than numbers if necessary (only used for glass eel in the connect method).
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
library(stacomiR) stacomi(database_expected=FALSE) ## launches the application in the command line ## here an example of loading ## the following lines will only run if you have the program installed ## and the iav scheme available in the database ## this example generates the r_mig_mult dataset # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.password = password ) r_mig_mult <- new("report_mig_mult") r_mig_mult <- choice_c(r_mig_mult, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGG","AGJ","CIV"), datedebut="2011-01-01", datefin="2011-12-31") r_mig_mult <- charge(r_mig_mult) # launching charge will also load classes associated with the report # e.g. report_ope, report_df, report_dc r_mig_mult <- connect(r_mig_mult) # calculations r_mig_mult <- calcule(r_mig_mult,silent=TRUE) ## End(Not run) # Use this as example if you don't have a connexion to the database data("r_mig_mult") # The following re-create the object at the time of loading # All three classes were created by the charge and connect # method of report_mig_mult in the previous example data("r_mig_mult_ope") assign("report_ope",r_mig_mult_ope,envir=envir_stacomi) data("r_mig_mult_df") assign("report_df",r_mig_mult_df,envir=envir_stacomi) data("r_mig_mult_dc") assign("report_dc",r_mig_mult_dc,envir=envir_stacomi) # use the following to get the raw data loaded by the connect method # not shown there as the database and program might not be installed #Individual plot for all DC, taxa and stage where data present ## Not run: plot(r_mig_mult,plot.type="standard",silent=TRUE) # colors in the following order (glass eel) # working, stopped, 1...5 types of operation,numbers, weight, 2 unused colors # for yellow eel and other taxa # stopped, 1...5 types of operation, ponctuel, expert, calcule,mesure,working, plot(r_mig_mult,plot.type="standard", color=c("#DEF76B","#B950B5","#9ABDDA","#781A74","#BF9D6E","#FFC26E", "#A66F24","#012746","#6C3E00","#DC7ED8","#8AA123"), color_ope=c("#5589B5","#FFDB6E","#FF996E","#1C4D76"), silent=TRUE) #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(r_mig_mult,plot.type="step",silent=TRUE) # Combined plot for ggplot2 plot(r_mig_mult,plot.type="multiple",silent=TRUE) # Data will be written in the data directory specified in # the datawd argument to stacomi, default "~" summary(r_mig_mult,silent=FALSE) ## End(Not run)
library(stacomiR) stacomi(database_expected=FALSE) ## launches the application in the command line ## here an example of loading ## the following lines will only run if you have the program installed ## and the iav scheme available in the database ## this example generates the r_mig_mult dataset # prompt for user and password but you can set appropriate options for host, port and dbname ## Not run: stacomi( database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.password = password ) r_mig_mult <- new("report_mig_mult") r_mig_mult <- choice_c(r_mig_mult, dc=c(5,6,12), taxa=c("Anguilla anguilla"), stage=c("AGG","AGJ","CIV"), datedebut="2011-01-01", datefin="2011-12-31") r_mig_mult <- charge(r_mig_mult) # launching charge will also load classes associated with the report # e.g. report_ope, report_df, report_dc r_mig_mult <- connect(r_mig_mult) # calculations r_mig_mult <- calcule(r_mig_mult,silent=TRUE) ## End(Not run) # Use this as example if you don't have a connexion to the database data("r_mig_mult") # The following re-create the object at the time of loading # All three classes were created by the charge and connect # method of report_mig_mult in the previous example data("r_mig_mult_ope") assign("report_ope",r_mig_mult_ope,envir=envir_stacomi) data("r_mig_mult_df") assign("report_df",r_mig_mult_df,envir=envir_stacomi) data("r_mig_mult_dc") assign("report_dc",r_mig_mult_dc,envir=envir_stacomi) # use the following to get the raw data loaded by the connect method # not shown there as the database and program might not be installed #Individual plot for all DC, taxa and stage where data present ## Not run: plot(r_mig_mult,plot.type="standard",silent=TRUE) # colors in the following order (glass eel) # working, stopped, 1...5 types of operation,numbers, weight, 2 unused colors # for yellow eel and other taxa # stopped, 1...5 types of operation, ponctuel, expert, calcule,mesure,working, plot(r_mig_mult,plot.type="standard", color=c("#DEF76B","#B950B5","#9ABDDA","#781A74","#BF9D6E","#FFC26E", "#A66F24","#012746","#6C3E00","#DC7ED8","#8AA123"), color_ope=c("#5589B5","#FFDB6E","#FF996E","#1C4D76"), silent=TRUE) #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(r_mig_mult,plot.type="step",silent=TRUE) # Combined plot for ggplot2 plot(r_mig_mult,plot.type="multiple",silent=TRUE) # Data will be written in the data directory specified in # the datawd argument to stacomi, default "~" summary(r_mig_mult,silent=FALSE) ## End(Not run)
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.
dc
Object of class ref_dc-class: the control device
taxa
Object of class ref_taxa-class: the species
stage
Object of class ref_stage-class : the stage of the fish
timestep
Object of class ref_timestep_daily-class : the time step constrained to daily value and 365 days
data
Object of class data.frame
with data filled in from the connect method
calcdata
A "list" of calculated daily data, one per dc, filled in by the calcule method
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.
time.sequence
Object of class POSIXct
: a time sequence of days generated by the calcule method
In practise, the report_mig class uses methods (calcule, connect...) from the more elaborate report_mig_mult-class
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
stacomi(database_expected=FALSE) # If you have a working database # the following line of code will create the r_mig dataset from the iav (default) # schema in the database ## Not run: stacomi(database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) stacomi( database_expected=TRUE) r_mig=new("report_mig") r_mig=choice_c(r_mig, dc=5, taxa=c("Chelon ramada"), stage=c("IND"), datedebut="2015-01-01", datefin="2015-12-31") r_mig<-charge(r_mig) # launching charge will also load classes associated with the report # e.g. report_ope, report_df, report_dc r_mig<-connect(r_mig) ######################## # calculations ######################## r_mig<-calcule(r_mig,silent=TRUE) ## End(Not run) ######################## # loading data ## use the following to get the raw data loaded by the connect method # not shown there as the database and program might not be installed # All three classes report... were created by the charge and connect method # of report_mig_mult # in the previous example ################################ data("r_mig") data("r_mig_ope") assign("report_ope",r_mig_ope,envir=envir_stacomi) data("r_mig_df") assign("report_df",r_mig_df,envir=envir_stacomi) data("r_mig_dc") assign("report_dc",r_mig_dc,envir=envir_stacomi) #Individual plot for all DC (standard), taxa and stage where data present #silent argument to stop all messages plot(r_mig,plot.type="standard",silent=TRUE) #cumulated migration at the station (all stages and DC grouped) plot(r_mig,plot.type="step") # data will be written in the data directory specified in datawd argument to stacomi default "~" #file ## Not run: summary(r_mig,silent=TRUE) ## End(Not run) # this will write the daily report for later in in the reportnMigrationInterannuelle-class ## Not run: write_database(r_mig,silent=TRUE,dbname="bd_contmig_nat",host="localhost",port=5432) ## End(Not run)
stacomi(database_expected=FALSE) # If you have a working database # the following line of code will create the r_mig dataset from the iav (default) # schema in the database ## Not run: stacomi(database_expected=TRUE) if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) stacomi( database_expected=TRUE) r_mig=new("report_mig") r_mig=choice_c(r_mig, dc=5, taxa=c("Chelon ramada"), stage=c("IND"), datedebut="2015-01-01", datefin="2015-12-31") r_mig<-charge(r_mig) # launching charge will also load classes associated with the report # e.g. report_ope, report_df, report_dc r_mig<-connect(r_mig) ######################## # calculations ######################## r_mig<-calcule(r_mig,silent=TRUE) ## End(Not run) ######################## # loading data ## use the following to get the raw data loaded by the connect method # not shown there as the database and program might not be installed # All three classes report... were created by the charge and connect method # of report_mig_mult # in the previous example ################################ data("r_mig") data("r_mig_ope") assign("report_ope",r_mig_ope,envir=envir_stacomi) data("r_mig_df") assign("report_df",r_mig_df,envir=envir_stacomi) data("r_mig_dc") assign("report_dc",r_mig_dc,envir=envir_stacomi) #Individual plot for all DC (standard), taxa and stage where data present #silent argument to stop all messages plot(r_mig,plot.type="standard",silent=TRUE) #cumulated migration at the station (all stages and DC grouped) plot(r_mig,plot.type="step") # data will be written in the data directory specified in datawd argument to stacomi default "~" #file ## Not run: summary(r_mig,silent=TRUE) ## End(Not run) # this will write the daily report for later in in the reportnMigrationInterannuelle-class ## Not run: write_database(r_mig,silent=TRUE,dbname="bd_contmig_nat",host="localhost",port=5432) ## End(Not run)
Operations are monitoring operations generated between two dates. In the case of video monitoring or similar, they can be instantaneous
Objects can be created by calls of the form
new("report_ope")
.
Cedric Briand [email protected]
The report_sample_char class is used to load and display sample characteristics, which can be either continuous or discrete variable, for instance, it can be used to analyze size or sex structure during a given period.
data
A data frame
dc
An object of class ref_dc-class: the control devices
taxa
An object of class ref_taxa-class: the species
stage
An object of class ref_stage-class : the stages of the fish
par
An object of class ref_par-class: the parameters used
horodatedebut
An object of class ref_horodate-class
horodatefin
An object of class ref_horodate-class
Objects can be created by calls of the form
new('report_sample_char', ...)
This class is displayed by interface_report_sample_char, in the database, the class calls the content of the view vue_lot_ope_car
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sea_age-class
,
report_silver_eel-class
,
report_species-class
# launching stacomi without connection to the database stacomi( database_expected=FALSE) # If you have a working database # the following line of code will create the r_sample_char # dataset from the iav (default) schema in the database ## Not run: stacomi(database_expected=TRUE) # uses default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_sample_char <- new("report_sample_char") # the following will load data for size, # parameters 1786 (total size) C001 (size at video control) # dc 5 and 6 are fishways located on the Arzal dam # two stages are selected r_sample_char <- choice_c(r_sample_char, dc=c(5,6), taxa=c("Anguilla anguilla"), stage=c("AGJ","CIV"), par=c(1785,1786,1787,"C001"), horodatedebut="2013-01-01", horodatefin="2013-12-31", silent=FALSE) # two warning produced, ignored if silent=TRUE r_sample_char <- connect(r_sample_char) r_sample_char <- calcule(r_sample_char,silent=TRUE) ## End(Not run) # load the dataset generated by previous lines data("r_sample_char") # A "violin" plot plot(r_sample_char,plot.type="1",silent=TRUE) # get the plot from envir_stacomi to change labels for name # if you use require(ggplot2) the :: argument is not needed # e.g. write require(ggplot2);g<-get("g",envir=envir_stacomi) # g+xlab("size")+ylab("year") if (requireNamespace("ggplot2", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) g+ggplot2::xlab("size")+ggplot2::ylab("year") } # A boxplot per month plot(r_sample_char,plot.type="2",silent=TRUE) # A xyplot plot(r_sample_char,plot.type="3",silent=TRUE) ## Not run: ##################################### # an example graph created manually from data ##################################### # two variables one on DC, one on stage # passing dc information to the stage variable r_sample_char@data$std_libelle[r_sample_char@data$ope_dic_identifiant==5]<- "Yellow eel (vert. slot fishway)" r_sample_char@data$std_libelle[r_sample_char@data$std_libelle=="Anguille jaune"]<- "Yellow eel (ramp)" r_sample_char@data$std_libelle[r_sample_char@data$std_libelle=="civelle"]<- "Glass eel (ramp)" # creating a boxplot with custom output : an example # again if you use require(ggplot2) the :: argument is not needed if (requireNamespace("ggplot2", quietly = TRUE)){ g<-ggplot2::ggplot(r_sample_char@data)+ ggplot2::geom_boxplot(ggplot2::aes(x=annee, y =car_valeur_quantitatif, fill = std_libelle))+ ggplot2::xlab("size")+ggplot2::ylab("year")+ ggplot2::scale_fill_manual("stage & fishway", values=c("Yellow eel (vert. slot fishway)"="blue", "Yellow eel (ramp)"="turquoise3", "Glass eel (ramp)"="Cyan"))+ ggplot2::theme_bw() print(g) } # get a simple summary using Hmisc::describe summary(r_sample_char) # get the command line to create the object using choice_c # when the graphical interface has been used print(r_sample_char) ## End(Not run)
# launching stacomi without connection to the database stacomi( database_expected=FALSE) # If you have a working database # the following line of code will create the r_sample_char # dataset from the iav (default) schema in the database ## Not run: stacomi(database_expected=TRUE) # uses default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_sample_char <- new("report_sample_char") # the following will load data for size, # parameters 1786 (total size) C001 (size at video control) # dc 5 and 6 are fishways located on the Arzal dam # two stages are selected r_sample_char <- choice_c(r_sample_char, dc=c(5,6), taxa=c("Anguilla anguilla"), stage=c("AGJ","CIV"), par=c(1785,1786,1787,"C001"), horodatedebut="2013-01-01", horodatefin="2013-12-31", silent=FALSE) # two warning produced, ignored if silent=TRUE r_sample_char <- connect(r_sample_char) r_sample_char <- calcule(r_sample_char,silent=TRUE) ## End(Not run) # load the dataset generated by previous lines data("r_sample_char") # A "violin" plot plot(r_sample_char,plot.type="1",silent=TRUE) # get the plot from envir_stacomi to change labels for name # if you use require(ggplot2) the :: argument is not needed # e.g. write require(ggplot2);g<-get("g",envir=envir_stacomi) # g+xlab("size")+ylab("year") if (requireNamespace("ggplot2", quietly = TRUE)){ g<-get("g",envir=envir_stacomi) g+ggplot2::xlab("size")+ggplot2::ylab("year") } # A boxplot per month plot(r_sample_char,plot.type="2",silent=TRUE) # A xyplot plot(r_sample_char,plot.type="3",silent=TRUE) ## Not run: ##################################### # an example graph created manually from data ##################################### # two variables one on DC, one on stage # passing dc information to the stage variable r_sample_char@data$std_libelle[r_sample_char@data$ope_dic_identifiant==5]<- "Yellow eel (vert. slot fishway)" r_sample_char@data$std_libelle[r_sample_char@data$std_libelle=="Anguille jaune"]<- "Yellow eel (ramp)" r_sample_char@data$std_libelle[r_sample_char@data$std_libelle=="civelle"]<- "Glass eel (ramp)" # creating a boxplot with custom output : an example # again if you use require(ggplot2) the :: argument is not needed if (requireNamespace("ggplot2", quietly = TRUE)){ g<-ggplot2::ggplot(r_sample_char@data)+ ggplot2::geom_boxplot(ggplot2::aes(x=annee, y =car_valeur_quantitatif, fill = std_libelle))+ ggplot2::xlab("size")+ggplot2::ylab("year")+ ggplot2::scale_fill_manual("stage & fishway", values=c("Yellow eel (vert. slot fishway)"="blue", "Yellow eel (ramp)"="turquoise3", "Glass eel (ramp)"="Cyan"))+ ggplot2::theme_bw() print(g) } # get a simple summary using Hmisc::describe summary(r_sample_char) # get the command line to create the object using choice_c # when the graphical interface has been used print(r_sample_char) ## End(Not run)
the report_sea_age class is used to dispatch adult salmons to age class according to their size and to basin dependent limits set by the user. Once checked with graphs and summary statistics, the results are to be written to the database.
data
A data frame with data generated from the database
calcdata
A list of dc with processed data. This lists consists of two elements
(1) data A dataset with age set to be used by the plot and summary methods
(2) tj_caracteristitiquelot_car A dataset to import into the database
dc
Object of class ref_dc-class: the control devices
taxa
Object of class ref_taxa-class: the species
stage
Object of class ref_stage-class : the stages of the fish
par
Object of class ref_par-class: the parameters used
horodatedebut
An object of class ref_horodate-class
horodatefin
An object of class ref_horodate-class
limit1hm
The size limit, in mm between 1 sea winter fishes and 2 sea winter fishes
limit2hm
The size limit, in mm between 2 sea winter fishes and 3 sea winter fishes
Objects can be created by calls of the form
new("report_sea_age", ...)
This class is displayed by interface_report_sea_age
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_silver_eel-class
,
report_species-class
require(stacomiR) stacomi( database_expected=FALSE) # If you have a working database # the following line of code will create the r_seaa dataset # from the logrami schema in the database ## Not run: stacomi(database_expected=TRUE, sch='logrami') # overrides the default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_seaa<-new("report_sea_age") r_seaa<-choice_c(r_seaa, dc=c(107,108,101), horodatedebut="2012-01-01", horodatefin="2012-12-31", limit1hm=675, limit2hm=875, silent=FALSE ) r_seaa<-connect(r_seaa) r_seaa<-calcule(r_seaa) ## End(Not run) # load the dataset generated by previous lines # Salmons from the loire on two dams data("r_seaa") # the calculation will fill the slot calcdata # stages are in r_seaa@calcdata[["6"]][,"stage"] #look at data structure using str(r_seaa@calcdata[["6"]]) # plot data to confirm the split by limits is correct plot(r_seaa, plot.type=1) # if there are several dc, data it split by dc plot(r_seaa, plot.type=2) ## Not run: # print a summary statistic, and save the output in a list for later use stats<-summary(r_seaa) write_database(r_seaa) ## End(Not run)
require(stacomiR) stacomi( database_expected=FALSE) # If you have a working database # the following line of code will create the r_seaa dataset # from the logrami schema in the database ## Not run: stacomi(database_expected=TRUE, sch='logrami') # overrides the default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_seaa<-new("report_sea_age") r_seaa<-choice_c(r_seaa, dc=c(107,108,101), horodatedebut="2012-01-01", horodatefin="2012-12-31", limit1hm=675, limit2hm=875, silent=FALSE ) r_seaa<-connect(r_seaa) r_seaa<-calcule(r_seaa) ## End(Not run) # load the dataset generated by previous lines # Salmons from the loire on two dams data("r_seaa") # the calculation will fill the slot calcdata # stages are in r_seaa@calcdata[["6"]][,"stage"] #look at data structure using str(r_seaa@calcdata[["6"]]) # plot data to confirm the split by limits is correct plot(r_seaa, plot.type=1) # if there are several dc, data it split by dc plot(r_seaa, plot.type=2) ## Not run: # print a summary statistic, and save the output in a list for later use stats<-summary(r_seaa) write_database(r_seaa) ## End(Not run)
the report_silver_eel 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 monitoring the silver eel run.
data
A data frame with data generated from the database
calcdata
A list of dc with processed data. Each dc contains a data frame with
(1) qualitative data on body contrast (CONT), presence of punctuation on the lateral line (LINP)
(2) quantitative data "BL" Body length,"W" weight,"Dv" vertical eye diameter,"Dh" horizontal eye diameter,"FL" pectoral fin length
(3) calculated durif stages, Pankhurst's index, Fulton's body weight coefficient K_ful
(4) other columns containing data pertaining to the sample and the control operation: lot_identifiant,ope_identifiant, ope_dic_identifiant,ope_date_debut,ope_date_fin,dev_code (destination code of fish), dev_libelle (text for destination of fish)
dc
Object of class ref_dc-class: the control devices
taxa
An object of class ref_taxa-class: the species
stage
An object of class ref_stage-class : the stages of the fish
par
An object of class ref_par-class: the parameters used
horodatedebut
An object of class ref_horodate-class
horodatefin
An object of class ref_horodate-class
Objects can be created by calls of the form
new("report_silver_eel", ...)
This class is displayed by interface_report_silver_eel
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_species-class
# launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE) # the following script will load data from the two Anguillere monitored in the Somme # If you have a working database # the following line of code will create the r_silver dataset # from the "fd80." schema in the database ## Not run: stacomi(database_expected=TRUE, sch="fd80.") # overrides the default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_silver<-new("report_silver_eel") r_silver<-choice_c(r_silver, dc=c(2,6), horodatedebut="2010-09-01", horodatefin="2016-10-04", silent=FALSE) r_silver<-connect(r_silver) ## End(Not run) # load the dataset generated by previous lines data("r_silver") # the calculation will fill the slot calcdata r_silver<-calcule(r_silver) # stages are in r_silver@calcdata[["6"]][,"stage"] #look at data structure using str(r_silver@calcdata[["6"]]) # standard plot as drawn by Laurent Beaulaton (Analyse des donnees d'argenture acquises en France) # showing Durif's stage according to size and eye diameter plot(r_silver, plot.type=1) # number per month or year and Durif's stage (year if number of dc >1) plot(r_silver, plot.type="2") # plot showing fulton's coefficient, and size weight graphs # inspired from Acou et al., 2009 # Differential Production and Condition Indices of Premigrant # Eels in Two Small Atlantic Coastal Catchments # of France plot(r_silver, plot.type="3") # get a list of summary data and print output to screen plot(r_silver, plot.type="4") # print a summary statistic, and save the output in a list for later use stats<-summary(r_silver)
# launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE) # the following script will load data from the two Anguillere monitored in the Somme # If you have a working database # the following line of code will create the r_silver dataset # from the "fd80." schema in the database ## Not run: stacomi(database_expected=TRUE, sch="fd80.") # overrides the default option sch = 'iav' # prompt for user and password, you can set these in the options, # including dbname and host if (interactive()){ if (!exists("user")){ user <- readline(prompt="Enter user: ") password <- readline(prompt="Enter password: ") } } options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host ="localhost", stacomiR.port = "5432", stacomiR.user = user, stacomiR.user = password ) #create an instance of the class r_silver<-new("report_silver_eel") r_silver<-choice_c(r_silver, dc=c(2,6), horodatedebut="2010-09-01", horodatefin="2016-10-04", silent=FALSE) r_silver<-connect(r_silver) ## End(Not run) # load the dataset generated by previous lines data("r_silver") # the calculation will fill the slot calcdata r_silver<-calcule(r_silver) # stages are in r_silver@calcdata[["6"]][,"stage"] #look at data structure using str(r_silver@calcdata[["6"]]) # standard plot as drawn by Laurent Beaulaton (Analyse des donnees d'argenture acquises en France) # showing Durif's stage according to size and eye diameter plot(r_silver, plot.type=1) # number per month or year and Durif's stage (year if number of dc >1) plot(r_silver, plot.type="2") # plot showing fulton's coefficient, and size weight graphs # inspired from Acou et al., 2009 # Differential Production and Condition Indices of Premigrant # Eels in Two Small Atlantic Coastal Catchments # of France plot(r_silver, plot.type="3") # get a list of summary data and print output to screen plot(r_silver, plot.type="4") # print a summary statistic, and save the output in a list for later use stats<-summary(r_silver)
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). It was altered to include ref_taxa, to allow excluding some of the most numerous taxa from reports. The taxa is reported unless a taxa has several stages, 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. The split argument currently takes values year or month. The class is intended to be used over long periods e.g years. The plot method writes either an histogram or a pie chart of number per year/week/month.
dc
an object of class ref_dc-class
taxa
Object of class ref_taxa-class: the species
start_year
Object of class ref_year-class
end_year
Object of class ref_year-class
data
data.frame
calcdata
data.frame
with data processed by the calc method
split
Object of class ref_list-class
ref_list referential class choose within a list
Cedric Briand [email protected]
Other report Objects:
report_annual-class
,
report_dc-class
,
report_df-class
,
report_env-class
,
report_ge_weight-class
,
report_mig-class
,
report_mig_char-class
,
report_mig_env-class
,
report_mig_interannual-class
,
report_mig_mult-class
,
report_sample_char-class
,
report_sea_age-class
,
report_silver_eel-class
# launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE) # the following script will load data # from the two Anguillere monitored in the Somme # If you have a working database # the following line of code will create the bilesp dataset from the "iav." # schema in the database ## Not run: bilesp<-new("report_species") # split is one of "none", "year", "week", "month bilesp<-choice_c(bilesp, dc=c(5,6,12), split="year", start_year="2008", end_year="2012", silent=FALSE) bilesp <- connect(bilesp) bilesp <- calcule(bilesp) plot(bilesp, plot.type="pie", silent=FALSE) plot(bilesp, plot.type="barplot", silent=FALSE) bilesp <- choice_c(bilesp, dc=c(5,6,12), split="month", start_year="2015", end_year="2016", silent=FALSE) bilesp <- charge(bilesp) bilesp <- connect(bilesp) plot(bilesp, plot.type="pie", silent=FALSE) plot(bilesp, plot.type="barplot", silent=FALSE) #length(unique(bilesp@calcdata$taxa_stage)) # 15 # here creating a vector of length 15 with nice blending colours if (requireNamespace("grDevices", quietly = TRUE)) { mycolorrampblue <- grDevices::colorRampPalette(c("#395B74", "#010F19")) mycolorrampyellow <- grDevices::colorRampPalette(c("#B59C53", "#271D00")) mycolorrampred <- grDevices::colorRampPalette(c("#B56F53", "#270B00")) color<-c(mycolorrampblue(5), mycolorrampyellow(5), mycolorrampred(5)) plot(bilesp,plot.type="barplot",color=color,silent=TRUE) } summary(bilesp) ## End(Not run)
# launching stacomi without selecting the scheme or interface stacomi( database_expected=FALSE) # the following script will load data # from the two Anguillere monitored in the Somme # If you have a working database # the following line of code will create the bilesp dataset from the "iav." # schema in the database ## Not run: bilesp<-new("report_species") # split is one of "none", "year", "week", "month bilesp<-choice_c(bilesp, dc=c(5,6,12), split="year", start_year="2008", end_year="2012", silent=FALSE) bilesp <- connect(bilesp) bilesp <- calcule(bilesp) plot(bilesp, plot.type="pie", silent=FALSE) plot(bilesp, plot.type="barplot", silent=FALSE) bilesp <- choice_c(bilesp, dc=c(5,6,12), split="month", start_year="2015", end_year="2016", silent=FALSE) bilesp <- charge(bilesp) bilesp <- connect(bilesp) plot(bilesp, plot.type="pie", silent=FALSE) plot(bilesp, plot.type="barplot", silent=FALSE) #length(unique(bilesp@calcdata$taxa_stage)) # 15 # here creating a vector of length 15 with nice blending colours if (requireNamespace("grDevices", quietly = TRUE)) { mycolorrampblue <- grDevices::colorRampPalette(c("#395B74", "#010F19")) mycolorrampyellow <- grDevices::colorRampPalette(c("#B59C53", "#271D00")) mycolorrampred <- grDevices::colorRampPalette(c("#B56F53", "#270B00")) color<-c(mycolorrampblue(5), mycolorrampyellow(5), mycolorrampred(5)) plot(bilesp,plot.type="barplot",color=color,silent=TRUE) } summary(bilesp) ## End(Not run)
Generic method to transform quantitative par into a qualitative one
setasqualitative(object, ...)
setasqualitative(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
The parm name becomes "parm_discrete". New values are created in the 'data[["parqual"]]' slot of the report and the parqual slot is updated
## S4 method for signature 'report_mig_char' setasqualitative(object, par, silent = FALSE, ...)
## S4 method for signature 'report_mig_char' setasqualitative(object, par, silent = FALSE, ...)
object |
An object of class ref_parquan-class |
par |
The code of a quantitative parameter |
silent |
Default FALSE, if TRUE the program should not display messages |
... |
Additional parms to the cut method cut |
An object of class ref_parquan-class with lines removed from r@data[["parquan"]]
and added (after transformation to qualitative values) in r@data[["parqal"]]
Cedric Briand [email protected]
This functions takes a data frame with a column with starting time and another with ending time If the period extends over midnight, it will be split into new lines, starting and ending at midnight
split_per_day(data, horodatedebut, horodatefin)
split_per_day(data, horodatedebut, horodatefin)
data |
The dataframe |
horodatedebut |
The beginning time |
horodatefin |
The ending time |
A data frame with four new columns, Hmin (hour min), Hmax (hmax), xmin (day) and xmax (next day), and new rows
cedric.briand
datatemp<-structure(list(per_dis_identifiant = c(1L, 1L, 1L), per_date_debut = structure(c(1420056600, 1420071000, 1420081200), class = c("POSIXct", "POSIXt"), tzone = ""), per_date_fin = structure(c(1420071000, 1420081200, 1421000000 ), class = c("POSIXct", "POSIXt"), tzone = ""), per_commentaires = c("fonct calcul", "fonct calcul", "fonct calcul"), per_etat_fonctionnement = c(1L, 0L, 0L), per_tar_code = 1:3, libelle = c("Fonc normal", "Arr ponctuel", "Arr maint")), .Names = c("per_dis_identifiant", "per_date_debut", "per_date_fin", "per_commentaires", "per_etat_fonctionnement", "per_tar_code", "libelle"), row.names = c(NA, 3L), class = "data.frame") newdf<-split_per_day(data=datatemp,horodatedebut="per_date_debut", horodatefin="per_date_fin")
datatemp<-structure(list(per_dis_identifiant = c(1L, 1L, 1L), per_date_debut = structure(c(1420056600, 1420071000, 1420081200), class = c("POSIXct", "POSIXt"), tzone = ""), per_date_fin = structure(c(1420071000, 1420081200, 1421000000 ), class = c("POSIXct", "POSIXt"), tzone = ""), per_commentaires = c("fonct calcul", "fonct calcul", "fonct calcul"), per_etat_fonctionnement = c(1L, 0L, 0L), per_tar_code = 1:3, libelle = c("Fonc normal", "Arr ponctuel", "Arr maint")), .Names = c("per_dis_identifiant", "per_date_debut", "per_date_fin", "per_commentaires", "per_etat_fonctionnement", "per_tar_code", "libelle"), row.names = c(NA, 3L), class = "data.frame") newdf<-split_per_day(data=datatemp,horodatedebut="per_date_debut", horodatefin="per_date_fin")
When database_expected=FALSE
a connection to the database is not expected. Therefore test are run by calling examples object stored in Rdata.
To change the language use Sys.setenv(LANG = 'fr') or Sys.setenv(LANG = 'en')
stacomi(database_expected=TRUE, datawd = "~", sch = "test")
stacomi(database_expected=TRUE, datawd = "~", sch = "test")
database_expected |
Boolean, if |
datawd |
The data working directory |
sch |
The schema in the stacomi database default 'test'. |
Nothing, called for its side effect of loading
Cedric Briand [email protected]
require(stacomiR) #launch stacomi ## Not run: stacomi(database_expected=TRUE, datawd='~',sch= "iav") ## End(Not run) # launch stacomi without connection to the database stacomi(database_expected=FALSE) # launch stacomi with options options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host = readline(prompt = "Enter host: "), stacomiR.port = "5432", stacomiR.user = readline(prompt = "Enter user: "), stacomiR.password = readline(prompt = "Enter password: ") ) # another usefull option to print all queries run by stacomiR to the console options('stacomiR.printqueries'= TRUE)
require(stacomiR) #launch stacomi ## Not run: stacomi(database_expected=TRUE, datawd='~',sch= "iav") ## End(Not run) # launch stacomi without connection to the database stacomi(database_expected=FALSE) # launch stacomi with options options( stacomiR.dbname = "bd_contmig_nat", stacomiR.host = readline(prompt = "Enter host: "), stacomiR.port = "5432", stacomiR.user = readline(prompt = "Enter user: "), stacomiR.password = readline(prompt = "Enter password: ") ) # another usefull option to print all queries run by stacomiR to the console options('stacomiR.printqueries'= TRUE)
summary for report_dc, write csv and html output, and prints summary statistics
## S4 method for signature 'report_dc' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_dc' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters (not used there) |
Nothing, called for its side effect of writing html, csv files and printing summary
Cedric Briand [email protected]
summary for report_df, write csv and html output, and prints summary statistics
## S4 method for signature 'report_df' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_df' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters (not used there) |
Nothing, called for its side effect of writing html, csv files and printing summary
Cedric Briand [email protected]
summary for report_mig_char
## S4 method for signature 'report_mig_char' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_mig_char' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters |
A table with the summary
Cedric Briand [email protected]
summary for report_mig_interannual provides summary statistics for the latest year (if silent=TRUE), or the year selected in the interface, if silent=FALSE. Mean, min and max are historical statistics and they always include the current year from the historical dataset.
## S4 method for signature 'report_mig_interannual' summary(object, year_choice = NULL, silent = FALSE, ...)
## S4 method for signature 'report_mig_interannual' summary(object, year_choice = NULL, silent = FALSE, ...)
object |
An object of class |
year_choice |
The year chosen to calculate statistics which will be displayed beside the historical series, |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters (not used there) |
A list, one element per DC
Cedric Briand [email protected]
summary for report_mig_mult calls functions funstat and funtable to create migration overviews and generate csv and html output in the user data directory
## S4 method for signature 'report_mig_mult' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_mig_mult' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters (not used there) |
Nothing, runs funstat and funtable method for each DC
Cedric Briand [email protected]
summary for report_mig calls functions funstat and funtable to create migration overviews and generate csv and html output in the user data directory
## S4 method for signature 'report_mig' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_mig' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters (not used there) |
Nothing, calls the summary.report_mig_mult method
Cedric Briand [email protected]
summary for report_sample_char
## S4 method for signature 'report_sample_char' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_sample_char' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters |
Nothing, called for its side effect of printing a summary
Cedric Briand [email protected]
summary for report_sea_age
## S4 method for signature 'report_sea_age' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_sea_age' summary(object, silent = FALSE, ...)
object |
An object of class report_sea_age-class |
silent |
Default FALSE, if TRUE the program should no display messages. |
... |
Additional parameters |
The summary
Cedric Briand [email protected]
summary for report_silver_eel
## S4 method for signature 'report_silver_eel' summary(object, silent = FALSE, ...)
## S4 method for signature 'report_silver_eel' summary(object, silent = FALSE, ...)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
... |
Additional parameters |
A list per DC with statistic for Durif stages, Pankhurst, MD Eye diameter, BL body length and weight W
Cedric Briand [email protected]
generate csv and html output in the user data directory
## S4 method for signature 'report_species' summary(object, silent = FALSE)
## S4 method for signature 'report_species' summary(object, silent = FALSE)
object |
An object of class |
silent |
Should the program stay silent or display messages, default FALSE |
nothing, but writes summary in get("datawd", envir = envir_stacomi)
, and prints output
Cedric Briand [email protected]
Generic method to delete entires from the database
supprime(object, ...)
supprime(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
calcule.report_ge_weight, calcule.report_mig_char, calcule.report_mig_env, calcule.report_mig_interannual,calcule.report_mig_mult,calcule.report_mig_mult, calcule.report_sample_char, calcule.report_sea_age, calcule.report_silver_eel, calcule.report_species
supprime method for 'ref_coe' class
## S4 method for signature 'ref_coe' supprime(object, tax, std, silent = FALSE)
## S4 method for signature 'ref_coe' supprime(object, tax, std, silent = FALSE)
object |
An object of class ref_coe-class |
tax |
'2038=Anguilla anguilla' |
std |
'CIV=civelle' |
silent |
Default FALSE, if TRUE the program should no display messages |
Nothing, called for side effect
Cedric Briand [email protected]
supprime method for report_mig_interannual class, deletes values in table t_bilanmigrationjournalier_bjo
## S4 method for signature 'report_mig_interannual' supprime(object, silent = TRUE)
## S4 method for signature 'report_mig_interannual' supprime(object, silent = TRUE)
object |
An object of class report_mig_interannual-class |
silent |
Should the operation be returning the number of rows deleted |
nothing, called for its side effect, removing lines from the database
Cedric Briand [email protected]
supprime method for report_mig_interannual class
## S4 method for signature 'report_sea_age' supprime(object, silent = FALSE)
## S4 method for signature 'report_sea_age' supprime(object, silent = FALSE)
object |
An object of class report_sea_age-class |
silent |
Default FALSE, if TRUE the program should no display messages |
Nothing, called for its side effect of deleting data in the database
Cedric Briand [email protected]
Transforms a vector into a string called within an sql command e.g. c(A,B,C) => in ('A','B','C')
vector_to_listsql(vect)
vector_to_listsql(vect)
vect |
a character vector |
A list of value
Cedric Briand [email protected]
Generic method write_database
write_database(object, ...)
write_database(object, ...)
object |
Object |
... |
Additional parms |
cedric.briand
Data will be written in tj_coefficientconversion_coe table, if the class retrieves some data from the database, those will be deleted first.
## S4 method for signature 'report_ge_weight' write_database(object, silent = FALSE)
## S4 method for signature 'report_ge_weight' write_database(object, silent = FALSE)
object |
An object of class report_ge_weight-class |
silent |
Boolean, if TRUE, information messages are not displayed |
Nothing, called for its side effect of writing to the database
Cedric Briand [email protected]
Daily values are needed to compare migrations from year to year, by the class report_mig_interannual-class. They are added by by this function.
## S4 method for signature 'report_mig' write_database(object, silent = TRUE)
## S4 method for signature 'report_mig' write_database(object, silent = TRUE)
object |
an object of class report_mig |
silent |
: TRUE to avoid messages, FALSE will need interactive mode as it calls for menu() |
Nothing, just writes data into the database
the user is asked whether or not he wants to overwrite data only when silent is FALSE, if no data are present in the database, the import is done anyway.
Cedric Briand [email protected]
## Not run: stacomi(database_expected=FALSE) data("r_mig") r_mig<-calcule(r_mig) write_database(report_mig=r_mig,silent=FALSE) ## End(Not run)
## Not run: stacomi(database_expected=FALSE) data("r_mig") r_mig<-calcule(r_mig) write_database(report_mig=r_mig,silent=FALSE) ## End(Not run)
The sea age characteristic is calculated from the measured or calculated size of salmon and with a size/age rule defined by the user.
## S4 method for signature 'report_sea_age' write_database(object, silent = TRUE)
## S4 method for signature 'report_sea_age' write_database(object, silent = TRUE)
object |
an object of class report_sea_age-class |
silent |
: Default FALSE, if TRUE the program should no display messages. |
Nothing, called for its side effect of writing data to the database
Cedric Briand [email protected]
xtable function for report_annual-class create an xtable objet but also assigns an add.to.column argument in envir_stacomi, for later use by the print.xtable method.
## S4 method for signature 'report_annual' xtable( x, caption = NULL, label = NULL, align = NULL, digits = 0, display = NULL, auto = FALSE, dc_name = NULL, tax_name = NULL, std_name = NULL )
## S4 method for signature 'report_annual' xtable( x, caption = NULL, label = NULL, align = NULL, digits = 0, display = NULL, auto = FALSE, dc_name = NULL, tax_name = NULL, std_name = NULL )
x |
an object of class "report_annual" |
caption |
see xtable |
label |
see xtable |
align |
see xtable, overidden if NULL |
digits |
default 0 |
display |
see xtable |
auto |
see xtable |
dc_name |
A string indicating the names of the DC, in the order of |
tax_name |
A string indicating the names of the taxa, if not provided latin names are used |
std_name |
A string indicating the stages names, if not provided then std_libelle are used |
A xtable for annual report
xtable function for report_mig_char-class create an xtable objet to be later used by the print.xtable method.
## S4 method for signature 'report_mig_char' xtable( x, caption = NULL, label = NULL, align = NULL, digits = NULL, display = NULL, auto = FALSE, ... )
## S4 method for signature 'report_mig_char' xtable( x, caption = NULL, label = NULL, align = NULL, digits = NULL, display = NULL, auto = FALSE, ... )
x |
an object of class 'report_mig_char' |
caption |
see xtable |
label |
see xtable |
align |
see xtable, overidden if NULL |
digits |
see xtable |
display |
see xtable |
auto |
see xtable |
... |
Additional parameters |
A xtable