report_mig_char-class | R Documentation |
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 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_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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.