[Stacomir-commits] r477 - in pkg/stacomir: . man/figures vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Feb 16 10:01:14 CET 2018


Author: legrand
Date: 2018-02-16 10:01:14 +0100 (Fri, 16 Feb 2018)
New Revision: 477

Modified:
   pkg/stacomir/README.Rmd
   pkg/stacomir/man/figures/README-silver-1.png
   pkg/stacomir/man/figures/interface_graph_taille_sat.png
   pkg/stacomir/vignettes/stacomir.Rmd
Log:


Modified: pkg/stacomir/README.Rmd
===================================================================
--- pkg/stacomir/README.Rmd	2018-02-15 21:18:07 UTC (rev 476)
+++ pkg/stacomir/README.Rmd	2018-02-16 09:01:14 UTC (rev 477)
@@ -235,7 +235,7 @@
 migration from monitoring operations which do not necessarily span a day, and convert the glass eel
 weight in numbers.
 
-```{r ,eval=TRUE,echo=TRUE}
+```{r ,eval=TRUE,echo=TRUE,error=TRUE}
    stacomi(gr_interface=FALSE,
 	  login_window=FALSE,
 	  database_expected=TRUE)	

Modified: pkg/stacomir/man/figures/README-silver-1.png
===================================================================
(Binary files differ)

Modified: pkg/stacomir/man/figures/interface_graph_taille_sat.png
===================================================================
(Binary files differ)

Modified: pkg/stacomir/vignettes/stacomir.Rmd
===================================================================
--- pkg/stacomir/vignettes/stacomir.Rmd	2018-02-15 21:18:07 UTC (rev 476)
+++ pkg/stacomir/vignettes/stacomir.Rmd	2018-02-16 09:01:14 UTC (rev 477)
@@ -235,3 +235,94 @@
 weight in numbers.
 
 
+```{r ,eval=FALSE,echo=TRUE}
+   stacomi(gr_interface=FALSE,
+	  login_window=FALSE,
+	  database_expected=TRUE)	
+  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)
+```
+
+The previous line generates data not only about the report_mig_mult class,
+but also run dependent classes which describe how the fishway (DF) and counting devices (DC) have been operated.
+Sometimes there is no data but only because the camera was not working. There are also information
+about the operations (e.g. periods at wich a trap content has been evaluated). Here we load what
+would have been generated if we had run the previous lines.
+
+
+
+One graph per DC, taxa and stage. 
+Below as an example, the glass eel migration in weight and number (top),
+the periods and type of operation for DF and DC, and the operation (trapping
+periods) (middle), a summary of migration per month (bottom).
+
+
+```{r rmmstd,eval=FALSE,echo=TRUE,fig.keep="last"}
+# chunk not evaluated as it produces 5 plot with dev.new() called in a loop
+Sys.setenv(LANG = "fr")
+  plot(r_mig_mult,plot.type="standard",silent=TRUE)
+```
+
+![](../man/figures/README-rmmstandard-1.png)
+
+Summary of migration for different stages and counting devices
+
+```{r rmmmult,eval=FALSE,echo=TRUE,fig.keep="all"}
+  plot(r_mig_mult,plot.type="multiple",silent=TRUE)
+```
+
+![](../man/figures/README-rmmmult-1.png)
+
+#### Silver eels
+
+This section provides a short example for the function
+calculating Durif's stages. Those maturity stages for silver eels are
+calculated from body characteristics. The dataset `coef_durif`
+corresponds to 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
+function `fun_stage_durif` choose the stage achieving the highest
+score ([Durif et al.,
+2009](http://fishlarvae.org/common/SiteMedia/durif%20et%20al%202009b.pdf))
+
+```{r silver,eval=TRUE,echo=TRUE,fig.height = 4, fig.width = 6,fig.keep="all"}
+require(stacomiR)
+data("coef_durif")
+# load a dataset of class report_silver_eel with data slot already prepared
+# here is an example of output 
+data("r_silver")
+r_silver <- calcule(r_silver)
+plot(r_silver, plot.type=3)
+#######################################
+# To use the function fun_stage_durif manually
+# create a matrix with columns BL","W","Dv","Dh","FL"
+#############################################
+# here it is extracted from the data at hand
+silver_eel<-as.matrix(r_silver at calcdata[[1]][,c("BL","W","Dv","Dh","FL")])
+head(silver_eel) # to see the first lines
+stage <- fun_stage_durif(silver_eel) # apply the function to the matrix
+stage[1:10] # look at the first 10 elements in vector silver
+```
+
+### R-GTK2 graphical interface
+
+The program is intended to be used by 'non experienced' R users. Launching
+`stacomi()` will create the interface. The interface looks like :
+
+![](../man/figures/interface_graph_taille_sat.png)
+
+License
+-------
+
+The STACOMI project is released under GPL-2.



More information about the Stacomir-commits mailing list