diff --git a/README.Rmd b/README.Rmd index 01b8988a3df5ef0f6b2d133845764a39be9bd4b9..c98b2f9617e6d002fecf1b32137eda935c756aeb 100644 --- a/README.Rmd +++ b/README.Rmd @@ -58,6 +58,24 @@ You can install the released version of stacomiR from [CRAN](https://CRAN.R-proj install.packages("stacomiR") ``` +You can also install from this gitlab (latest release from the current default branch) with: + +``` r +remotes::install_gitlab( + "stacomi/stacomir", + host = "forgemia.inra.fr" +) +``` + +and for a given branch (or commit or a tag): + +``` r +remotes::install_gitlab( + "stacomi/stacomir@0.6.0.1", + host = "forgemia.inra.fr" +) +``` + ## Example This is the best way to launch stacomi if you don't want to test it with @@ -74,30 +92,31 @@ here we are using report annual to get the number per years, first we prompt for user and password but you can set other options. ``` {r withdatabase} - library(stacomiR) +library(stacomiR) # connect to the stacomi with database - -o <- options() -options( - stacomiR.dbname = "bd_contmig_nat", - stacomiR.host ="localhost", - stacomiR.port ="5432", - stacomiR.user = "postgres", - stacomiR.password = "postgres" -) -stacomi(database_expected = TRUE) + +o <- options() +options( + stacomiR.dbname = "bd_contmig_nat", + stacomiR.host = "localhost", + stacomiR.port = "5432", + stacomiR.user = "stacomi_test", + stacomiR.password = "stacomi_test" +) +stacomi(database_expected = TRUE) # set up a basic report for eel two stages (yellow and silver) annual number in pass 5, 6, 12 (fishway, left bank eel pass, right bank eel pass) # At the Arzal dam, and collects numbers from 1996 to 2015. -r_ann <- new("report_annual") +r_ann <- new("report_annual") r_ann <- choice_c( - r_ann, - dc = c(5, 6, 12), - taxa =c("Anguilla anguilla"), - stage = c("AGJ", "AGG"), - start_year ="1996", - end_year = "2015", - silent = TRUE) -r_ann <- connect(r_ann, silent = TRUE) + r_ann, + dc = c(5, 6, 12), + taxa = c("Anguilla anguilla"), + stage = c("AGJ", "AGG"), + start_year = "1996", + end_year = "2015", + silent = TRUE +) +r_ann <- connect(r_ann, silent = TRUE) options(o) ``` diff --git a/README.md b/README.md index 4a0d8ebbac8c5b6473d195c5e26f4ef889b0dc8c..d8c314faa617b74c6232fdc53a2bd0ebbc538731 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,25 @@ You can install the released version of stacomiR from install.packages("stacomiR") ``` +You can also install from this gitlab (latest release from the current +default branch) with: + +``` r +remotes::install_gitlab( + "stacomi/stacomir", + host = "forgemia.inra.fr" +) +``` + +and for a given branch (or commit or a tag): + +``` r +remotes::install_gitlab( + "stacomi/stacomir@0.6.0.1", + host = "forgemia.inra.fr" +) +``` + ## Example This is the best way to launch stacomi if you don’t want to test it with @@ -69,33 +88,34 @@ here we are using report annual to get the number per years, first we prompt for user and password but you can set other options. ``` r - library(stacomiR) +library(stacomiR) # connect to the stacomi with database - -o <- options() -options( - stacomiR.dbname = "bd_contmig_nat", - stacomiR.host ="localhost", - stacomiR.port ="5432", - stacomiR.user = "stacomi_test", - stacomiR.password = "stacomi_test" -) -stacomi(database_expected = TRUE) + +o <- options() +options( + stacomiR.dbname = "bd_contmig_nat", + stacomiR.host = "localhost", + stacomiR.port = "5432", + stacomiR.user = "stacomi_test", + stacomiR.password = "stacomi_test" +) +stacomi(database_expected = TRUE) # set up a basic report for eel two stages (yellow and silver) annual number in pass 5, 6, 12 (fishway, left bank eel pass, right bank eel pass) # At the Arzal dam, and collects numbers from 1996 to 2015. -r_ann <- new("report_annual") +r_ann <- new("report_annual") r_ann <- choice_c( - r_ann, - dc = c(5, 6, 12), - taxa =c("Anguilla anguilla"), - stage = c("AGJ", "AGG"), - start_year ="1996", - end_year = "2015", - silent = TRUE) + r_ann, + dc = c(5, 6, 12), + taxa = c("Anguilla anguilla"), + stage = c("AGJ", "AGG"), + start_year = "1996", + end_year = "2015", + silent = TRUE +) #> Warning in .local(object, ...): Attention, year 1996 is not available in the #> database, available years : none #> Warning in .local(object, ...): Attention, year 2015 is not available in the #> database, available years : none -r_ann <- connect(r_ann, silent = TRUE) +r_ann <- connect(r_ann, silent = TRUE) options(o) ```