[Stacomir-commits] r522 - in pkg/stacomir: . tests tests/testthat
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Sep 28 11:26:26 CEST 2018
Author: legrand
Date: 2018-09-28 11:26:25 +0200 (Fri, 28 Sep 2018)
New Revision: 522
Added:
pkg/stacomir/tests/testthat.R
Removed:
pkg/stacomir/README.Rmd
pkg/stacomir/README.md
pkg/stacomir/paper.bib
pkg/stacomir/paper.md
Modified:
pkg/stacomir/
pkg/stacomir/tests/
pkg/stacomir/tests/testthat/test-01-report_mig_mult.R
Log:
Property changes on: pkg/stacomir
___________________________________________________________________
Modified: svn:ignore
- CalcmigData
test
.README.md.html
*.html
+ *.html
.README.md.html
CalcmigData
Installation
README.Rmd
README.md
paper.bib
paper.md
test
Deleted: pkg/stacomir/README.Rmd
===================================================================
--- pkg/stacomir/README.Rmd 2018-09-28 08:13:01 UTC (rev 521)
+++ pkg/stacomir/README.Rmd 2018-09-28 09:26:25 UTC (rev 522)
@@ -1,324 +0,0 @@
----
-title: StacomiR
-author: Marion Legrand, Cédric Briand
-output: github_document
----
-
-
-[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/stacomiR)](https://cran.r-project.org/package=stacomiR)
-
-```{r knitropt, include=FALSE}
- require(knitr)
-opts_knit$set(message=FALSE, warnings=FALSE,error=FALSE,include=FALSE)
-```
-
-```{r echo = FALSE}
-knitr::opts_chunk$set(
- collapse = TRUE,
- comment = "#>",
- fig.path = "man/figures/README-"
-)
-```
-
-# stacomiR <img src="man/figures/logo.png" align="right" />
-
-```{r echo=FALSE}
-library(stacomiR)
-
-```
-Introduction
---------------------------
-
-Migratory fishes population are vulnerable as they are often more prone to human
-impact when migrating in rivers and to the ocean ([McDowall,
-1992](http://onlinelibrary.wiley.com.inee.bib.cnrs.fr/doi/10.1002/aqc.3270020405/pdf)). They are often counted at
-stations when they perform the migrations at some of their lifestages, and these
-counts provide valuable indices to the population size and trend. The objective
-of the stacomi project is to provide a common database for people monitoring
-fish migration, so that data from watershed are shared, and stocks exchanging
-between different basins are better managed. The stacomi database, is an
-open-source database, it managed with a JAVA interface, and results from that
-database are treated directly with the stacomiR project.
-
-
-Installation
--------------------------
-
-The package is available from CRAN, a development version is available from
-R-Forge.
-
-```{r , eval=FALSE}
-install.packages("stacomiR") # get the package from CRAN
-install.packages("stacomiR", repos="http://R-Forge.R-project.org") # get the development version
-```
-
-Usage
--------------------------
-
-Launch the graphical interface
-
-```{r , eval=FALSE}
-stacomi()
-```
-
-The program can be launched to use from the command line
-
-```{r , eval=FALSE}
-stacomi(gr_interface = FALSE, login_window = TRUE, database_expected = TRUE)
-```
-
-
-Data structure
--------------------
-The open source postgresql database comprises a common schema with dictionaries,
-and different schema for different users. Each user can save its own schema and
-send it to others. The
-database comprises tables related to infrastructure, operations and fish
-samples.
-*Contact the authors to get a copy of the database*.
-
-### Infrastructure
-
-
-#### Station
-
-A migration report is always built on a section of a river, this is called the
-station. A station of fish migration monitoring is a section of a watercourse
-where fish upstream or downstream migration is monitored. The station covers the
-whole section of a single river, but can extend to several natural or artificial
-channels. A station consists physically of as many dams as hydrographic sections
-monitored (river, channels, etc.). According to the local settings, it
-corresponds to one river location with a counting device, or to one or several
-dams. For example, in the figure below we can see a station with three crossing device (DF 1 to 3)
-and two counting device (DC 1 to 2), the first one beeing a trap counting device (DC1) and the other a video-counting device (DC2).
-
-![plot](man/figures/StationComptage.png)
-
-
-
-#### Dams
-The concept of dam used in the context of fish migration monitoring database
-refers to a system blocking or guiding the migratory flow like :
-
-* weir,
-
-* electric guide barrier,
-
-* netting dam,
-
-* etc.
-
-
-#### Crossing device
-A crossing device (DF) is a passageway that allows and concentrates the
-migratory flow between upstream and downstream sections of a dam. They can be of
-various type :
-
-* fishway,
-
-* spillway,
-
-* fish elevator,
-
-* eel trapping ladder,
-
-* etc.
-
-It is possible to have more than one crossing device on a same dam.
-
-#### Counting device
-A counting device (DC) is a set of equipment installed on a crossing device used
-to monitor fish migration. It can be :
-
-* a video counting device,
-
-* a trap,
-
-* an accoustic counting device,
-
-* ...
-
-
-#### Monitoring operation
-An operation corresponds to a monitoring of a counting device during a time
-span.
-
-#### Sample
-A sample corresponds to a batch of fishes passing during a monitoring operation.
-Sample characteristics (length, weight, sex, body measurements) are attached to
-the sample. For each sample the species and the stage (which corresponds to a
-maturation stage and is related to migratory behaviour) is recorded.
-
-#### Other features
-The database also handles, marking-recapture operations, pathologies, samples
-collection (scale, fin sample for genetic...), fate of fishes (released, death,
-farmed, etc.), etc...
-Some tables are also used to insert information
-about environmental condition such as turbidity, atmospheric pressure,
-temperature, flow ...
-
-
- Package structure
---------------------
-The package relies on S4 classes. *Referential classes* are used to access data
-from the database (taxa, stages, counting devices...).
-*Report classes* are built from referential classes and have different methods
-to access the database *connect methods*, generate calculations *calcule
-method*, or plot results.
-For instance, the migration report class comprises slots for :
-
-* DC The counting device (camera, trap, acoustic device...)
-
-* taxa The species list from the database and the taxa selected
-
-* stage The stages list from the database and the stage selected
-
-* starting date The date of beginning
-
-* ending date The last date of the report
-
-Read the help files e.g. `? report_mig` to get documentation on the following
-classes.
-
-| Class | Command | description|
-| ------------- |:----------|:--------------------------------------- |
-|report_mig | `new("report_mig")` | Migration report (single) |
-| report_mig_mult| `new("report_mig_mult")`| Migr. (several DC,taxa...) |
-| report_annual| `new("report_annual")`| Multi year migration counts |
-| report_dc | `new("report_dc")`| Counting device operation |
-| report_df | `new("report_df")`| Fishway operation |
-| report_mig_env | `new("report_env")`| Migration crossed with env. factors |
-| report_mig_char | `new("report_df")`| Migration with fish characteristics |
-|report_mig_interannual | `new("report_mig_interannual")`| Comp. between years|
-|report_sample_char | `new("report_sample_char")`| Sample characteristics |
-|report_ge_weight | `new("report_ge_weight")`| Trend in glass eel weight |
-|report_silver_eel | `new("report_siver_eel")`| Silver eel migration & stage|
-|report_sea_age | `new("report_sea_age")`| Set sea age for Salmon |
-|report_species | `new("report_species")`| Species composition |
-
-
-Working examples
--------------------------
-
-### Command line
-
-#### Migration report
-
-Examples are provided with each of the class, you can access them simply by
-typing `? report_mig_mult`
-The program is intented to be used in conjuntion with the database, to test it
-without access, use the arguments `login_windows=FALSE` and
-`database_expected=FALSE`
-
-
-```{r , eval=TRUE, echo=TRUE}
-## launches the application in the command line without connection to the database
-stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE)
-```
-The
-following code is only run when there is a connection to the database. The
-program will create an object of the class report_mig_mult, and run it for several DC, here 5 is a
-vertical slot fishway, and 6 and 12 are two glass eel trapping ladder located
-at the Arzal dam in the
-Vilaine river (France).
-We are evaluating the migration
-of all stages of eel (glass eel CIV, yellow eel AGJ and silver eel AGG).
-Glass
-eel and yellow eel migrate to the watershed while silver eels
-are migrating back
-to the ocean.
-Data are loaded from the database with the `charge` method and the `calcule`
-method
-will
-interpolate
-daily
-migration from monitoring operations which do not necessarily span a day, and convert the glass eel
-weight in numbers.
-
-```{r ,eval=TRUE,echo=TRUE,error=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=FALSE,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)
-```
-
-![plot of chunk rmmmult](man/figures/README-rmmstandard-1.png)
-
-Summary of migration for different stages and counting devices
-
-```{r rmmmult,eval=TRUE,echo=FALSE,fig.keep="all"}
- plot(r_mig_mult,plot.type="multiple",silent=TRUE)
-```
-
-#### 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.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 :
-
-![plot](man/figures/interface_graph_taille_sat.png)
-
-License
--------
-
-The STACOMI project is released under GPL-2.
\ No newline at end of file
Deleted: pkg/stacomir/README.md
===================================================================
--- pkg/stacomir/README.md 2018-09-28 08:13:01 UTC (rev 521)
+++ pkg/stacomir/README.md 2018-09-28 09:26:25 UTC (rev 522)
@@ -1,308 +0,0 @@
-StacomiR
-================
-Marion Legrand, Cédric Briand
-
-[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/stacomiR)](https://cran.r-project.org/package=stacomiR)
-
-# stacomiR <img src="man/figures/logo.png" align="right" />
-
-## Introduction
-
-Migratory fishes population are vulnerable as they are often more prone
-to human impact when migrating in rivers and to the ocean ([McDowall,
-1992](http://onlinelibrary.wiley.com.inee.bib.cnrs.fr/doi/10.1002/aqc.3270020405/pdf)).
-They are often counted at stations when they perform the migrations at
-some of their lifestages, and these counts provide valuable indices to
-the population size and trend. The objective of the stacomi project is
-to provide a common database for people monitoring fish migration, so
-that data from watershed are shared, and stocks exchanging between
-different basins are better managed. The stacomi database, is an
-open-source database, it managed with a JAVA interface, and results from
-that database are treated directly with the stacomiR project.
-
-## Installation
-
-The package is available from CRAN, a development version is available
-from R-Forge.
-
-``` r
-install.packages("stacomiR") # get the package from CRAN
-install.packages("stacomiR", repos="http://R-Forge.R-project.org") # get the development version
-```
-
-## Usage
-
-Launch the graphical interface
-
-``` r
-stacomi()
-```
-
-The program can be launched to use from the command
-line
-
-``` r
-stacomi(gr_interface = FALSE, login_window = TRUE, database_expected = TRUE)
-```
-
-## Data structure
-
-The open source postgresql database comprises a common schema with
-dictionaries, and different schema for different users. Each user can
-save its own schema and send it to others. The database comprises tables
-related to infrastructure, operations and fish samples. *Contact the
-authors to get a copy of the database*.
-
-### Infrastructure
-
-#### Station
-
-A migration report is always built on a section of a river, this is
-called the station. A station of fish migration monitoring is a section
-of a watercourse where fish upstream or downstream migration is
-monitored. The station covers the whole section of a single river, but
-can extend to several natural or artificial channels. A station consists
-physically of as many dams as hydrographic sections monitored (river,
-channels, etc.). According to the local settings, it corresponds to one
-river location with a counting device, or to one or several dams. For
-example, in the figure below we can see a station with three crossing
-device (DF 1 to 3) and two counting device (DC 1 to 2), the first one
-beeing a trap counting device (DC1) and the other a video-counting
-device (DC2).
-
-![plot](man/figures/StationComptage.png)
-
-#### Dams
-
-The concept of dam used in the context of fish migration monitoring
-database refers to a system blocking or guiding the migratory flow like
-:
-
- - weir,
-
- - electric guide barrier,
-
- - netting dam,
-
- - etc.
-
-#### Crossing device
-
-A crossing device (DF) is a passageway that allows and concentrates the
-migratory flow between upstream and downstream sections of a dam. They
-can be of various type :
-
- - fishway,
-
- - spillway,
-
- - fish elevator,
-
- - eel trapping ladder,
-
- - etc.
-
-It is possible to have more than one crossing device on a same dam.
-
-#### Counting device
-
-A counting device (DC) is a set of equipment installed on a crossing
-device used to monitor fish migration. It can be :
-
- - a video counting device,
-
- - a trap,
-
- - an accoustic counting device,
-
- - â¦
-
-#### Monitoring operation
-
-An operation corresponds to a monitoring of a counting device during a
-time span.
-
-#### Sample
-
-A sample corresponds to a batch of fishes passing during a monitoring
-operation. Sample characteristics (length, weight, sex, body
-measurements) are attached to the sample. For each sample the species
-and the stage (which corresponds to a maturation stage and is related to
-migratory behaviour) is recorded.
-
-#### Other features
-
-The database also handles, marking-recapture operations, pathologies,
-samples collection (scale, fin sample for geneticâ¦), fate of fishes
-(released, death, farmed, etc.), etc⦠Some tables are also used to
-insert information about environmental condition such as turbidity,
-atmospheric pressure, temperature, flow â¦
-
-## Package structure
-
-The package relies on S4 classes. *Referential classes* are used to
-access data from the database (taxa, stages, counting devicesâ¦). *Report
-classes* are built from referential classes and have different methods
-to access the database *connect methods*, generate calculations *calcule
-method*, or plot results. For instance, the migration report class
-comprises slots for :
-
- - DC The counting device (camera, trap, acoustic deviceâ¦)
-
- - taxa The species list from the database and the taxa selected
-
- - stage The stages list from the database and the stage selected
-
- - starting date The date of beginning
-
- - ending date The last date of the report
-
-Read the help files e.g. `? report_mig` to get documentation on the
-following
-classes.
-
-| Class | Command | description |
-| ------------------------ | :------------------------------ | :---------------------------------- |
-| report\_mig | `new("report_mig")` | Migration report (single) |
-| report\_mig\_mult | `new("report_mig_mult")` | Migr. (several DC,taxaâ¦) |
-| report\_annual | `new("report_annual")` | Multi year migration counts |
-| report\_dc | `new("report_dc")` | Counting device operation |
-| report\_df | `new("report_df")` | Fishway operation |
-| report\_mig\_env | `new("report_env")` | Migration crossed with env. factors |
-| report\_mig\_char | `new("report_df")` | Migration with fish characteristics |
-| report\_mig\_interannual | `new("report_mig_interannual")` | Comp. between years |
-| report\_sample\_char | `new("report_sample_char")` | Sample characteristics |
-| report\_ge\_weight | `new("report_ge_weight")` | Trend in glass eel weight |
-| report\_silver\_eel | `new("report_siver_eel")` | Silver eel migration & stage |
-| report\_sea\_age | `new("report_sea_age")` | Set sea age for Salmon |
-| report\_species | `new("report_species")` | Species composition |
-
-## Working examples
-
-### Command line
-
-#### Migration report
-
-Examples are provided with each of the class, you can access them simply
-by typing `? report_mig_mult` The program is intented to be used in
-conjuntion with the database, to test it without access, use the
-arguments `login_windows=FALSE` and
-`database_expected=FALSE`
-
-``` r
-## launches the application in the command line without connection to the database
-stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE)
-```
-
-The following code is only run when there is a connection to the
-database. The program will create an object of the class
-report\_mig\_mult, and run it for several DC, here 5 is a vertical slot
-fishway, and 6 and 12 are two glass eel trapping ladder located at the
-Arzal dam in the Vilaine river (France). We are evaluating the migration
-of all stages of eel (glass eel CIV, yellow eel AGJ and silver eel AGG).
-Glass eel and yellow eel migrate to the watershed while silver eels are
-migrating back to the ocean. Data are loaded from the database with the
-`charge` method and the `calcule` method will interpolate daily
-migration from monitoring operations which do not necessarily span a
-day, and convert the glass eel weight in numbers.
-
-``` r
- 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")
-#> [1] Choice made, and object report_mig_mult assigned in envir_stacomi
- 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)
-#> data collected from the database nrow=400
-#> [1] Loading data for operations
-#> [1] Time steps loaded fot this counting device\n
-#> [1] Time steps of the fishway loaded\n
- # 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).
-
-![plot of chunk rmmmult](man/figures/README-rmmstandard-1.png)
-
-Summary of migration for different stages and counting devices
-
-![](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
-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)
-#> Warning in predict.lm(rlmmodb, newdata = newdata, se.fit = TRUE, type = "response", : Assuming constant prediction variance even though model fit is weighted
-```
-
-![](man/figures/README-silver-1.png)<!-- -->
-
-``` r
-#######################################
-# 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
-#> BL W Dv Dh FL
-#> 25710 830 1074 8.14 8.70 39.79
-#> 25711 714 740 8.24 8.52 38.04
-#> 25712 720 755 6.92 6.87 34.01
-#> 25713 860 1101 10.53 10.43 44.47
-#> 25714 716 752 7.42 8.76 33.78
-#> 25715 690 622 7.83 9.25 29.58
-stage <- fun_stage_durif(silver_eel) # apply the function to the matrix
-stage[1:10] # look at the first 10 elements in vector silver
-#> 25710 25711 25712 25713 25714 25715 25716 25717 25718 25719
-#> "FIII" "FIII" "FIII" "FIV" "FIII" "FIII" "FV" "FV" "FIII" "FIII"
-```
-
-### 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 :
-
-![plot](man/figures/interface_graph_taille_sat.png)
-
-## License
-
-The STACOMI project is released under GPL-2.
Deleted: pkg/stacomir/paper.bib
===================================================================
--- pkg/stacomir/paper.bib 2018-09-28 08:13:01 UTC (rev 521)
+++ pkg/stacomir/paper.bib 2018-09-28 09:26:25 UTC (rev 522)
@@ -1,39 +0,0 @@
-
- at article{mcdowall_1992,
-
- title = {Particular problems for the conservation of diadromous fish},
-
- volume = {2},
- issn = {1099-0755},
-
- url = {http://onlinelibrary.wiley.com.inee.bib.cnrs.fr/doi/10.1002/aqc.3270020405/abstract},
-
- doi = {10.1002/aqc.3270020405},
-
- language = {en},
-
- number = {4},
-
- urldate = {2018-02-05},
-
- journal = {Aquatic Conservation: Marine and Freshwater Ecosystems},
-
- author = {McDowall, R. M.},
-
- month = dec,
-
- year = {1992},
-
- pages = {351--355},
-
- file = {McDowall, 1992.pdf:C\:\\Users\\marion.legrand\\Zotero\\storage\\25FHWJCS\\McDowall, 1992.pdf:application/pdf;Snapshot:C\:\\Users\\marion.legrand\\Zotero\\storage\\HCSYYC4I\\pdf.html:text/html}
-
-}
- at Manual{R2017,
- title = {R: A Language and Environment for Statistical Computing},
- author = {{R Core Team}},
- organization = {R Foundation for Statistical Computing},
- address = {Vienna, Austria},
- year = {2017},
- url = {https://www.R-project.org/},
- }
\ No newline at end of file
Deleted: pkg/stacomir/paper.md
===================================================================
--- pkg/stacomir/paper.md 2018-09-28 08:13:01 UTC (rev 521)
+++ pkg/stacomir/paper.md 2018-09-28 09:26:25 UTC (rev 522)
@@ -1,64 +0,0 @@
----
-title: 'stacomiR : a common tool for monitoring fish migration'
-authors:
- - name: Marion Legrand
- affiliation: "1, 2"
- - name: Cédric Briand
- affiliation: 3
-affiliations:
- - name: EcoLab, Université de Toulouse, CNRS, INPT, UPS, Toulouse, France
- index: 1
- - name: Loire Grands Migrateurs (LOGRAMI), 5, avenue Buffon, Orléans, France
- index: 2
- - name: Etablissement Public Territorial du Bassin de la Vilaine (EPTB Vilaine), Boulevard de Bretagne, La Roche-Bernard, France
- index: 3
-
-date: 15 May 2018
-bibliography: paper.bib
----
-
-# Summary
-
-Migratory fishes population are vulnerable as they are often more prone to human impact when migrating in rivers and to the ocean [@mcdowall_1992].
-They are often counted at stations when they perform the migrations at some of their lifestages, and these counts provide valuable indices to
-the population size and trend.
-The objective of the stacomi project is to provide a common database for people monitoring fish migration, so that data from watershed are shared, and stocks exchanging between different basins are better managed. The stacomi database, is an open-source database, it managed with a JAVA interface, and results from
-that database are treated directly with the stacomiR package [@R2017]. The program is intended to be used by a "non experienced" R user, but all the R code automatically generated by the programm is shown to the user. Thus, it is possible to copy/paste the code and modify it (for example to change the preprogrammed colors or make more complicated changes).
-The package is available from CRAN, a development version is available
-from R-Forge.
-
-```{R}
-# Installation
-install.packages("stacomiR") # get the package from CRAN
-install.packages("stacomiR", repos="http://R-Forge.R-project.org") # get the development version
-library(stacomiR)
-
-# Launch the graphical interface
-## For user having the stacomi database
-stacomi()
-## For user without connection to the database
-stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE)
-```
-
-Launching `stacomi()` will create the interface. The interface looks
-like :
-
-![](man/figures/interface_graph_taille_sat.png)
-
-```{R}
-# Plot for 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).
-## For user without the connection to the database
-data("r_mig_mult")
-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)
-plot(r_mig_mult,plot.type="standard",silent=TRUE)
-
-```
-![](man/figures/README-rmmstandard-1.png)
-
-# References
\ No newline at end of file
Property changes on: pkg/stacomir/tests
___________________________________________________________________
Deleted: svn:ignore
- testthat.R
Modified: pkg/stacomir/tests/testthat/test-01-report_mig_mult.R
===================================================================
--- pkg/stacomir/tests/testthat/test-01-report_mig_mult.R 2018-09-28 08:13:01 UTC (rev 521)
+++ pkg/stacomir/tests/testthat/test-01-report_mig_mult.R 2018-09-28 09:26:25 UTC (rev 522)
@@ -101,6 +101,7 @@
test_that("Test example 01_report_mig_mult",
{
+ skip_on_cran()
# check if built with examples (Rtools install --example
example_path<-file.path(.libPaths()[1],"stacomiR","R-ex","report_mig_mult-class.R")
test<-file.access(example_path,0)
Added: pkg/stacomir/tests/testthat.R
===================================================================
--- pkg/stacomir/tests/testthat.R (rev 0)
+++ pkg/stacomir/tests/testthat.R 2018-09-28 09:26:25 UTC (rev 522)
@@ -0,0 +1,56 @@
+#install.packages("testthat",dependencies=c("Depends", "Imports"))
+#install.packages("relax")
+require(testthat)
+require(stacomiR)
+
+#getUsername <- function(){
+# name <- Sys.info()[["user"]]
+# return(name)
+#}
+#if(getUsername() == 'cedric.briand')
+#{
+# setwd("C:/workspace/stacomir/pkg/stacomir/")
+#}
+#if(getUsername() == 'marion.legrand')
+#{
+# setwd("C:/Users/logrami/workspace/stacomir/pkg/stacomir/")
+#}
+#
+#
+## to launch all
+#
+#
+#if(getUsername() == 'cedric.briand')
+#{
+# skip_on_cran()
+# test_dir("C:/workspace/stacomir/pkg/stacomir/tests/testthat")
+#}
+#if(getUsername() == 'marion.legrand')
+#{
+# skip_on_cran()
+# test_dir("C:/Users/logrami/workspace/stacomir/pkg/stacomir/tests/testthat")
+#}
+
+test_check("stacomiR")
+
+
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-00-stacomir.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-00-zrefclasses.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-01-report_mig_mult.R"))
+## warning we don't need to be worried about
+##Quoted identifiers should have class SQL, use DBI::SQL() if the caller performs the quoting.
+## this comes from incompatibility between RSQLite 1.1-1 and sqldf
+## we don't really use RSQLite and this is only a warning not a problem
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-02-report_mig.R"))
+## if errors check existence of dbname test and grants to test on dbname test
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-03-report_df.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-04-report_dc.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-05-report_sample_char.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-06-report_mig_interannual.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-07-report_sea_age.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-08-report_silver_eel.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-09-report_annual.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-10-report_env.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-11-report_mig_env.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-12-report_mig_char.R"))
+#test_file(stringr::str_c(getwd(),"/tests/testthat/test-13-report_species.R"))
More information about the Stacomir-commits
mailing list