report_sea_age-class | R Documentation |
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 cedric.briand@eptb-vilaine.fr
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.