[Stacomir-commits] r587 - pkg/stacomir/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Nov 9 11:59:39 CET 2021


Author: briand
Date: 2021-11-09 11:59:39 +0100 (Tue, 09 Nov 2021)
New Revision: 587

Modified:
   pkg/stacomir/man/report_annual-class.Rd
   pkg/stacomir/man/report_dc-class.Rd
   pkg/stacomir/man/report_df-class.Rd
   pkg/stacomir/man/report_env-class.Rd
   pkg/stacomir/man/report_ge_weight-class.Rd
   pkg/stacomir/man/report_mig-class.Rd
   pkg/stacomir/man/report_mig_char-class.Rd
   pkg/stacomir/man/report_mig_env-class.Rd
   pkg/stacomir/man/report_mig_interannual-class.Rd
   pkg/stacomir/man/report_mig_mult-class.Rd
   pkg/stacomir/man/report_sample_char-class.Rd
   pkg/stacomir/man/report_sea_age-class.Rd
   pkg/stacomir/man/report_silver_eel-class.Rd
   pkg/stacomir/man/report_species-class.Rd
   pkg/stacomir/man/write_database-report_mig-method.Rd
Log:
manual

Modified: pkg/stacomir/man/report_annual-class.Rd
===================================================================
--- pkg/stacomir/man/report_annual-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_annual-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -26,13 +26,26 @@
 }}
 
 \examples{
-require(stacomiR)
-# launching stacomi without selecting the scheme or interface
-stacomi(
-	database_expected=FALSE, sch='iav')
-# the following script will load the Arzal dataset if connected to iav schema
-
+# launching stacomi without database for demo
+stacomi(database_expected=FALSE)
+# the following piece of script will load the Arzal dataset and connected to iav postgres schema
+# it requires a working database
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
+	stacomi(database_expected=TRUE, sch='iav')
+	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_ann<-new("report_annual")
   r_ann<-choice_c(r_ann,
 	  dc=c(5,6,12),

Modified: pkg/stacomir/man/report_dc-class.Rd
===================================================================
--- pkg/stacomir/man/report_dc-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_dc-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -29,14 +29,27 @@
 }
 
 \examples{
-require(stacomiR)
-stacomi(
-	database_expected=FALSE)
-###########################################################
-## An example that will work only if the database is present 
-## and the program installed and comprises the schema iav
-###########################################################"
+
+# this option allows to launch the program without the interface to display some of the program features.
+stacomi(database_expected=FALSE)
+# An example that will work only if the database is present 
+# and the program installed and comprises the schema iav
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
+	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_dc=new("report_dc")
   r_dc<-choice_c(r_dc,
 	  5,

Modified: pkg/stacomir/man/report_df-class.Rd
===================================================================
--- pkg/stacomir/man/report_df-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_df-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -37,11 +37,26 @@
 }
 
 \examples{
-require(stacomiR)
 stacomi(
 	database_expected=FALSE)
-## An example that will work with the database installed only
+# An example that will work with the database installed only and schema iav in the database
+# prompt for user and password but you can set appropriate options for host, port and dbname
+stacomi(
+		database_expected=TRUE, sch='iav')	
 \dontrun{
+	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_df=new("report_df")
   r_df<-choice_c(r_df,
 	  1,

Modified: pkg/stacomir/man/report_env-class.Rd
===================================================================
--- pkg/stacomir/man/report_env-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_env-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -23,10 +23,22 @@
 }}
 
 \examples{
-require(stacomiR)
 stacomi(
 	database_expected=FALSE)
 \dontrun{
+	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_env<-new("report_env")
   r_env<-choice_c(r_env,
 	  stationMesure=c("temp_gabion","coef_maree"),

Modified: pkg/stacomir/man/report_ge_weight-class.Rd
===================================================================
--- pkg/stacomir/man/report_ge_weight-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_ge_weight-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -51,7 +51,24 @@
 # launching stacomi without selecting the scheme or interface
 stacomi(
 	database_expected=FALSE, sch='iav')
+# this requires a working database with the schema iav
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
+	stacomi(
+			database_expected=TRUE, sch='iav')	
+	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						
+	)	
   #create an instance of the class
   r_gew<-new("report_ge_weight")
   r_gew at liste<-charge(object=r_gew at liste,listechoice=c("=1",">1","tous"),label="")

Modified: pkg/stacomir/man/report_mig-class.Rd
===================================================================
--- pkg/stacomir/man/report_mig-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_mig-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -37,14 +37,24 @@
 In practise, the report_mig class uses methods (calcule, connect...) from the more elaborate \link{report_mig_mult-class}
 }
 \examples{
-library(stacomiR)
-
 stacomi(database_expected=FALSE) 
-## launches the application in the command line
-## here an example of loading
-## not run as the program is possibly not installed
-## this example generates the r_mig dataset
-\dontrun{
+# If you have a working database
+# the following line of code will create the r_mig dataset from the iav (default) schema in the database
+\dontrun{	
+	stacomi(database_expected=TRUE)	
+	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						
+	)	
   stacomi(
 	  database_expected=TRUE)	
   r_mig=new("report_mig")

Modified: pkg/stacomir/man/report_mig_char-class.Rd
===================================================================
--- pkg/stacomir/man/report_mig_char-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_mig_char-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -55,8 +55,24 @@
 
 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
 \dontrun{
+	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

Modified: pkg/stacomir/man/report_mig_env-class.Rd
===================================================================
--- pkg/stacomir/man/report_mig_env-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_mig_env-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -31,7 +31,23 @@
 	database_expected=FALSE)
 # the following will load the data provided the user has access to the database
 # with data in the iav example scheme.
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
+	stacomi(
+			database_expected=TRUE)	
+	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_env<-new("report_mig_env")
   r_mig_env<-choice_c(r_mig_env,
 	  dc=c(5,6,12),

Modified: pkg/stacomir/man/report_mig_interannual-class.Rd
===================================================================
--- pkg/stacomir/man/report_mig_interannual-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_mig_interannual-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -41,9 +41,24 @@
 # launching stacomi without selecting the scheme or interface
 stacomi(
 	database_expected=FALSE, sch='pmp')
-###### If you have connection to the database with the pmp scheme ############
+# If you have connection to the database with the pmp scheme 
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
-  
+	stacomi(
+			database_expected=TRUE)	
+	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						
+	)	
   # overriding user schema to point to Parc Marais Poitevin 
   # (longest historical dataset available
   # in France for eel ...) this suppose you have access to the pmp schema...

Modified: pkg/stacomir/man/report_mig_mult-class.Rd
===================================================================
--- pkg/stacomir/man/report_mig_mult-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_mig_mult-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -53,9 +53,23 @@
 ## the following lines will only run if you have the program installed
 ## and the iav scheme available in the database
 ## this example generates the r_mig_mult dataset
+# prompt for user and password but you can set appropriate options for host, port and dbname
 \dontrun{
   stacomi(
 	  database_expected=TRUE)	
+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_mult=new("report_mig_mult")
   r_mig_mult=choice_c(r_mig_mult,
 	  dc=c(5,6,12),

Modified: pkg/stacomir/man/report_sample_char-class.Rd
===================================================================
--- pkg/stacomir/man/report_sample_char-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_sample_char-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -38,20 +38,33 @@
 }
 
 \examples{
-require(stacomiR)
-# launching stacomi without selecting the scheme or interface
-stacomi(
-	database_expected=FALSE)
-# the following script will load the Arzal dataset 
-#if connected to iav schema
+# launching stacomi without connection to the database
+stacomi(	database_expected=FALSE)
+# If you have a working database
+# the following line of code will create the r_sample_char dataset from the iav (default) schema in the database
 \dontrun{
+	stacomi(database_expected=TRUE)	# uses default option sch = 'iav'
+	# prompt for user and password, you can set these in the options, including dbname and host
+	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						
+	)	
   #create an instance of the class
-  r_sample_char<-new("report_sample_char")
+  r_sample_char <- new("report_sample_char")
   # the following will load data for size, 
   # parameters 1786 (total size) C001 (size at video control)
   # dc 5 and 6 are fishways located on the Arzal dam
   # two stages are selected
-  r_sample_char<-choice_c(r_sample_char,
+  r_sample_char <- choice_c(r_sample_char,
 	  dc=c(5,6),
 	  taxa=c("Anguilla anguilla"),
 	  stage=c("AGJ","CIV"),
@@ -60,8 +73,8 @@
 	  horodatefin="2013-12-31",
 	  silent=FALSE)
   # two warning produced, ignored if silent=TRUE
-  r_sample_char<-connect(r_sample_char)
-  r_sample_char<-calcule(r_sample_char,silent=TRUE)
+  r_sample_char <- connect(r_sample_char)
+  r_sample_char <- calcule(r_sample_char,silent=TRUE)
   
 }	
 # load the dataset generated by previous lines

Modified: pkg/stacomir/man/report_sea_age-class.Rd
===================================================================
--- pkg/stacomir/man/report_sea_age-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_sea_age-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -49,8 +49,25 @@
 \examples{
 require(stacomiR)
 stacomi(
-	database_expected=FALSE, sch= 'logrami')
+	database_expected=FALSE)
+# If you have a working database
+# the following line of code will create the r_seaa dataset from the logrami schema in the database
 \dontrun{
+		stacomi(database_expected=TRUE, sch='logrami')	# overrides the default option sch = 'iav'
+		# prompt for user and password, you can set these in the options, including dbname and host
+		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						
+		)	
   #create an instance of the class
   r_seaa<-new("report_sea_age")
   r_seaa<-choice_c(r_seaa,

Modified: pkg/stacomir/man/report_silver_eel-class.Rd
===================================================================
--- pkg/stacomir/man/report_silver_eel-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_silver_eel-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -47,17 +47,31 @@
 }
 
 \examples{
-require(stacomiR)
 # launching stacomi without selecting the scheme or interface
-stacomi(
-	database_expected=FALSE, sch ='fd80')
+stacomi(	database_expected=FALSE)
 # the following script will load data from the two Anguillere monitored in the Somme
 
+# If you have a working database
+# the following line of code will create the r_silver dataset from the "fd80." schema in the database
 \dontrun{
+	stacomi(database_expected=TRUE, sch="fd80.")	# overrides the default option sch = 'iav'
+	# prompt for user and password, you can set these in the options, including dbname and host
+	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						
+	)	
+	
   #create an instance of the class
   r_silver<-new("report_silver_eel")
-  sch<-rlang::env_get(envir_stacomi, "sch")
-  assign("sch","fd80.",envir_stacomi)
   r_silver<-choice_c(r_silver,
 	  dc=c(2,6),			
 	  horodatedebut="2010-09-01",

Modified: pkg/stacomir/man/report_species-class.Rd
===================================================================
--- pkg/stacomir/man/report_species-class.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/report_species-class.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -33,9 +33,13 @@
 }}
 
 \examples{
-require(stacomiR)
-stacomi(
-	database_expected=FALSE)
+# launching stacomi without selecting the scheme or interface
+stacomi(	database_expected=FALSE)
+# the following script will load data from the two Anguillere monitored in the Somme
+
+# If you have a working database
+# the following line of code will create the bilesp dataset from the "iav." schema in the database
+
 \dontrun{
   bilesp<-new("report_species")
   # split is one of "none", "year", "week", "month
@@ -45,27 +49,34 @@
 	  anneedebut="2008",
 	  anneefin="2012",
 	  silent=FALSE)	
-  #bilesp<-charge(bilesp) this is used by the graphical interface
-  bilesp<-connect(bilesp)
-  bilesp<-calcule(bilesp)
-  plot(bilesp,plot.type="pie",silent=FALSE)
-  plot(bilesp,plot.type="barplot",silent=FALSE)
-  bilesp<-choice_c(bilesp,
+  bilesp <- connect(bilesp)
+  bilesp <- calcule(bilesp)
+  plot(bilesp, plot.type="pie", silent=FALSE)
+  plot(bilesp, plot.type="barplot", silent=FALSE)
+  bilesp <- choice_c(bilesp,
 	  dc=c(5,6,12),
 	  split="month",
 	  anneedebut="2015",
 	  anneefin="2016",
 	  silent=FALSE)
-  bilesp<-charge(bilesp)
-  bilesp<-connect(bilesp)
-  plot(bilesp,plot.type="pie",silent=FALSE)
-  plot(bilesp,plot.type="barplot",silent=FALSE)
+  bilesp <- charge(bilesp)
+  bilesp <- connect(bilesp)
+  plot(bilesp, plot.type="pie", silent=FALSE)
+  plot(bilesp, plot.type="barplot", silent=FALSE)
   #length(unique(bilesp at calcdata$taxa_stage)) # 15
   # here creating a vector of length 15 with nice blending colours
+	if (requireNamespace("grDevices", quietly = TRUE) {
+	mycolorrampblue <-
+			grDevices::colorRampPalette(c("#395B74", "#010F19"))
+	mycolorrampyellow <-
+			grDevices::colorRampPalette(c("#B59C53", "#271D00"))
+	mycolorrampred <-
+			grDevices::colorRampPalette(c("#B56F53", "#270B00"))
   color<-c(mycolorrampblue(5),
 	  mycolorrampyellow(5),
 	  mycolorrampred(5))
   plot(bilesp,plot.type="barplot",color=color,silent=TRUE)
+	}
   summary(bilesp)
 }	
 

Modified: pkg/stacomir/man/write_database-report_mig-method.Rd
===================================================================
--- pkg/stacomir/man/write_database-report_mig-method.Rd	2021-11-09 10:52:03 UTC (rev 586)
+++ pkg/stacomir/man/write_database-report_mig-method.Rd	2021-11-09 10:59:39 UTC (rev 587)
@@ -3,8 +3,7 @@
 \name{write_database,report_mig-method}
 \alias{write_database,report_mig-method}
 \alias{write_database.report_mig}
-\title{handler h_report_migwrite
-Allows the saving of daily and monthly counts in the database}
+\title{Command line method to write the daily and monthly counts to the t_bilanmigrationjournalier_bjo table}
 \usage{
 \S4method{write_database}{report_mig}(object, silent = TRUE, check_for_bjo = TRUE)
 }
@@ -15,19 +14,12 @@
 
 \item{check_for_bjo}{: do you want to check if data are already present in the bjo table, and delete them,
 this param was added otherwise connect method when called from report_mig_interannual runs in loops}
-
-\item{h}{a handler}
-
-\item{...}{Additional parameters}
 }
 \description{
-handler h_report_migwrite
-Allows the saving of daily and monthly counts in the database
+Daily values are needed to compare migrations from year to year, by the class \link{report_mig_interannual-class}. They are added by
+by this function.
 }
 \note{
-these entries are necessary to run the Interannual Migration class.
-then no entry will be written to the database
-
 the user is asked whether or not he wants to overwrite data only when silent is FALSE, if no
 data are present in the database, the import is done anyway.
 }
@@ -41,35 +33,4 @@
 }
 \author{
 Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-
-Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 }
-\keyword{Command}
-\keyword{Daily}
-\keyword{They}
-\keyword{\link{report_mig_interannual-class}.}
-\keyword{added}
-\keyword{and}
-\keyword{are}
-\keyword{by}
-\keyword{class}
-\keyword{compare}
-\keyword{counts}
-\keyword{daily}
-\keyword{from}
-\keyword{function.}
-\keyword{internal}
-\keyword{line}
-\keyword{method}
-\keyword{migrations}
-\keyword{monthly}
-\keyword{needed}
-\keyword{t_bilanmigrationjournalier_bjo}
-\keyword{table}
-\keyword{the}
-\keyword{this}
-\keyword{to}
-\keyword{values}
-\keyword{write}
-\keyword{year}
-\keyword{year,}



More information about the Stacomir-commits mailing list