stacomiR (version 0.5.3)

report_mig_char-class: Migration report along with quantitative and qualitative characteristics

Description

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.

Arguments

Slots

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 from the Class

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.

See Also

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

Examples

Run this code
# NOT RUN {
require(stacomiR)

stacomi(gr_interface=FALSE,
	login_window=FALSE,
	database_expected=FALSE)

# }
# NOT RUN {
  r_mig_char<-new("report_mig_char")
  baseODBC<-get("baseODBC",envir=envir_stacomi)
  baseODBC[c(2,3)]<-rep("logrami",2)
  assign("baseODBC",baseODBC,envir_stacomi)
  sch<-get("sch",envir=envir_stacomi)
  assign("sch","logrami.",envir_stacomi)
  # 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('A124','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)
  
# }
# NOT RUN {
# load the dataset generated by previous lines
data("r_mig_char")
# age will be plotted as a qualitative variable
r_mig_char<-setasqualitative(r_mig_char,par='A124',
    breaks=c(0,1.5,2.5,10),
    label=c("age 1","age 2","age 3"))
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)
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
# }
# NOT RUN {
# An example with several years
  r_mig_char<-new("report_mig_char")
  baseODBC<-get("baseODBC",envir=envir_stacomi)
  baseODBC[c(2,3)]<-rep("logrami",2)
  assign("baseODBC",baseODBC,envir_stacomi)
  sch<-get("sch",envir=envir_stacomi)
  assign("sch","logrami.",envir_stacomi)
# here parqual is not in the list
# so this is equivalent to parqual=NULL
  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('A124','C001','1786','1785'),
	  horodatedebut="2009-01-01",
	  horodatefin="2012-12-31",
	  #echantillon="with", # alternative "without"
	  silent=FALSE)
# r_mig_char<-charge(r_mig_char) not necessary there
  r_mig_char<-connect(r_mig_char)
# load the dataset generated by previous lines
  r_mig_char<-setasqualitative(r_mig_char,par='A124',
      breaks=c(0,1.5,2.5,10),
      label=c("age 1","age 2","age 3"))
  r_mig_char<-calcule(r_mig_char,silent=TRUE)
  
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace