[Stacomir-commits] r179 - in pkg/stacomir: R inst/config

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Aug 24 21:57:35 CEST 2016


Author: briand
Date: 2016-08-24 21:57:35 +0200 (Wed, 24 Aug 2016)
New Revision: 179

Modified:
   pkg/stacomir/R/BilanConditionEnv.r
   pkg/stacomir/R/BilanEspeces.r
   pkg/stacomir/R/BilanFonctionnementDC.r
   pkg/stacomir/R/BilanMigration.r
   pkg/stacomir/R/BilanMigrationConditionEnv.r
   pkg/stacomir/R/BilanMigrationInterAnnuelle.r
   pkg/stacomir/R/BilanMigrationMult.r
   pkg/stacomir/R/Bilan_carlot.r
   pkg/stacomir/R/Bilan_poids_moyen.r
   pkg/stacomir/R/Bilan_stades_pigm.r
   pkg/stacomir/R/Bilan_taille.r
   pkg/stacomir/R/PasdeTemps.r
   pkg/stacomir/R/data.r
   pkg/stacomir/R/fungraph.r
   pkg/stacomir/R/fungraph_civelle.r
   pkg/stacomir/R/fungraph_env.r
   pkg/stacomir/R/funtable.r
   pkg/stacomir/R/funtraitement_poids.r
   pkg/stacomir/R/interface_BilanMigrationMult.r
   pkg/stacomir/R/stacomi.r
   pkg/stacomir/R/utilitaires.r
   pkg/stacomir/inst/config/stacomi_manual_launch.r
Log:
Further changes, documentation .. for Rcheck

Modified: pkg/stacomir/R/BilanConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanConditionEnv.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanConditionEnv.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -102,8 +102,8 @@
 
 # affiche un graphe si des CE sont dans la base pendant la periode selectionnee
 #' hbilanConditionEnvgraph function called by handler which displays a graphe if environmental conditons are in the database during the selected period
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 hbilanConditionEnvgraph = function(h,...) 

Modified: pkg/stacomir/R/BilanEspeces.r
===================================================================
--- pkg/stacomir/R/BilanEspeces.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanEspeces.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -85,8 +85,8 @@
 #' handler du calcul du BilanEspeces
 #' realise le calcul du bilan especes, l'ecrit dans l'environnement envir_stacomi
 #' traite eventuellement les quantites de lots (si c'est des civelles)
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 hBilanEspecescalc=function(h,...){
@@ -200,8 +200,8 @@
 #' handler du calcul BilanEspeces : traitements 
 #' appelle les fonctions funstat et funtable pour faire le bilan des migrations
 #' dans des fichiers csv
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 hTableBilanEspeces=function(h,...) {

Modified: pkg/stacomir/R/BilanFonctionnementDC.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDC.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanFonctionnementDC.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -97,8 +97,8 @@
 # Compte tenu de la structure des donnees ce n'est pas si simple... 
 
 #' Function to create a barchart (lattice) corresponding to the periods
-#' @param h A handler
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @return assigns the data frame \code{periodeDC} allowing to build the lattice graph in the environment envir_stacomi
 #' 
 #' @author cedric.briand
@@ -169,8 +169,8 @@
 
 #' function used for some lattice graph 
 #' 
-#' @param h A handler
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @export
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 funboxDC = function(h,...) {  

Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanMigration.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -165,8 +165,8 @@
 #' handler hBilanMigrationgraph
 #' calls the fungraph for BilanMigration and allows the saving of daily and monthly counts in the database
 #' @note pb if other than daily value, the time steps have been constrained to daily values for this plot
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 hbilanMigrationgraph = function(h,...) {
 	if (exists("bilanMigration",envir_stacomi)) {

Modified: pkg/stacomir/R/BilanMigrationConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanMigrationConditionEnv.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanMigrationConditionEnv.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -55,8 +55,8 @@
 #' handler du graphique BilanMigrationConditionEnv
 #' realise le calcul du bilan migration avec CE, l'ecrit dans l'environnement envir_stacomi
 #' traite eventuellement les quantites de lots (si c'est des civelles)
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 hbilanMigrationConditionEnvcalc=function(h,...){

Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -295,7 +295,7 @@
 		} else {
 			# si nul on remplace par jour pour generer le script en dessous
 			timesplit="jour"
-			jour2000=as.Date(trunc.POSIXt(seq.POSIXt(from=strptime("2000-01-01",format='%Y-%m-%d'),
+			jour2000=as.Date(Hmisc::trunc.POSIXt(seq.POSIXt(from=strptime("2000-01-01",format='%Y-%m-%d'),
 							to=strptime("2000-12-31",format='%Y-%m-%d'), by="day"), digits='days'))
 			for (j in unique(dat$annee)){
 				# les jours qui n'ont pas de bilan journalier pour ce jour sont rajoutes avec zero
@@ -430,8 +430,8 @@
 							ymin="mintab",ymax="maxtab"),fill="grey60",alpha=0.5,size=0.5)
 			g <- g+geom_crossbar(stat="identity",aes_string(ymin="valeur",ymax="valeur",col="comp"),fatten=2)
 			#g <- g+scale_x_date(name=paste("mois"),breaks="month",minor_breaks=getvalue(new("Refperiode"),label=date_format("%b"),timesplit))
-			#lim=as.POSIXct(c(trunc.POSIXt((min(tmp[tmp$com!="0",timesplit])),"month")-delai,
-			#				ceil.POSIXt((max(tmp[tmp$com!="0",timesplit])),"month")+delai)) 
+			#lim=as.POSIXct(c(Hmisc::trunc.POSIXt((min(tmp[tmp$com!="0",timesplit])),"month")-delai,
+			#				Hmisc::ceil.POSIXt((max(tmp[tmp$com!="0",timesplit])),"month")+delai)) 
 			# pb the limit truncs the value
 			g <- g+ylab("effectif")
 			cols <- c("max" = "blue","min" = "red",">=moy" = "darkgreen", "<moy" = "darkorange","0"="grey10")
@@ -550,7 +550,7 @@
 		g <- g+scale_x_datetime(name=paste("mois"),breaks="month",
 				minor_breaks=getvalue(new("Refperiode"),timesplit),
 				labels=date_format("%b"),
-				limits=as.POSIXct(c(trunc.POSIXt((min(dat[dat$valeur!=0,timesplit])),"month"),ceil.POSIXt((max(dat[dat$valeur!="0",timesplit])),"month")))) 
+				limits=as.POSIXct(c(Hmisc::trunc.POSIXt((min(dat[dat$valeur!=0,timesplit])),"month"),Hmisc::ceil.POSIXt((max(dat[dat$valeur!="0",timesplit])),"month")))) 
 		g <- g+scale_y_continuous(name="Somme des pourcentages annuels de migration par quinzaine")
 		cols <- grDevices::rainbow(length(levels(dat$annee)))
 		g <- g+scale_fill_manual(name="annee",values=cols)

Modified: pkg/stacomir/R/BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/BilanMigrationMult.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/BilanMigrationMult.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -292,8 +292,8 @@
 #' handler for graphe method in BilanMigrationMult class
 #' 
 #' internal use
-#' @param h handler
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 hbilanMigrationMult_graph=function(h=null,...){
 	if (exists("bilanMigrationMult",envir_stacomi)) {
@@ -374,6 +374,7 @@
 									if (bilanMigrationMult at calcdata[[stringr::str_c("dc_",dc)]][["contient_poids"]]&
 											taxon=="Anguilla anguilla"&
 											stade=="civelle") {
+										
 										#----------------------------------
 										# bilan migration avec poids (civelles
 										#-----------------------------------------
@@ -386,6 +387,7 @@
 												dc=dc,
 												...)
 									}	else {
+									
 										#----------------------------------
 										# bilan migration standard
 										#-----------------------------------------
@@ -516,8 +518,8 @@
 #' handler for calculations
 #' 
 #'  internal use for graphical interface
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @seealso BilanMigrationMult
 hbilanMigrationMultcalc=function(h=null,...){
@@ -530,8 +532,8 @@
 #' handler du calcul hBilanMigrationgraph2
 #' 
 #' cumuls de migration au cours du temps
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 hbilanMigrationMultgraph2 = function(h=null,...) {
 	if (exists("bilanMigrationMult",envir_stacomi)) {
@@ -546,8 +548,8 @@
 #' hanler
 #' 
 #' internal use
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 hbilanMigrationMultgraph3 = function(h=null,...) {
 	if (exists("bilanMigrationMult",envir_stacomi)) {
@@ -565,8 +567,8 @@
 #' handler function 
 #' 
 #' internal use
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 hTableBilanMigrationMult=function(h=null,...) {
 	funout("Tableau de sortie \n")
@@ -585,7 +587,7 @@
 #' calls functions funstat and funtable to create migration overviews
 #' and generate csv and html output in the user data directory
 #' 
-#' @param ... 
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 setMethod("summary",signature=signature(object="BilanMigrationMult"),definition=function(object,...){
@@ -641,8 +643,8 @@
 		})
 
 #' handler to print the command line
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 houtBilanMigrationMult=function(h=null,...) {
 	if (exists("refStades",envir_stacomi)) 	{

Modified: pkg/stacomir/R/Bilan_carlot.r
===================================================================
--- pkg/stacomir/R/Bilan_carlot.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/Bilan_carlot.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -166,8 +166,8 @@
 #' fundensityBilan_carlot uses ggplot2 to draw density plots
 #' 
 #' assigns an object g in envir_stacomi for eventual modification of the plot
-#' @param h 
-#' @param ... 
+#' @param h A handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 fundensityBilan_carlot = function(h,...) {
@@ -224,7 +224,7 @@
 #' 
 #' funtableBilan_carlot shows a table of results in gdf
 #' @param h hanlder passed by the graphical interface
-#' @param ... 
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export
 funtableBilan_carlot = function(h,...) {

Modified: pkg/stacomir/R/Bilan_poids_moyen.r
===================================================================
--- pkg/stacomir/R/Bilan_poids_moyen.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/Bilan_poids_moyen.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -185,7 +185,7 @@
 	# graphique des poids moyens en fonction du milieu de l'operation de contrele)
 	# la date est la date moyenne du lot
 	
-# fonction handler appellees
+
 	hgra=function(h,...){
 		p<-qplot(x=date,y=poids_moyen,data=don) 
 		print(p)

Modified: pkg/stacomir/R/Bilan_stades_pigm.r
===================================================================
--- pkg/stacomir/R/Bilan_stades_pigm.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/Bilan_stades_pigm.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -699,9 +699,9 @@
 						border=NA)
 				curvsum=curvsum-curv[[strdates[j]]][[k]]$y
 			}
-			segments(    x0=as.numeric(as.POSIXct(trunc.POSIXt(dates[j],digits="day"))),
+			segments(    x0=as.numeric(as.POSIXct(Hmisc::trunc.POSIXt(dates[j],digits="day"))),
 					y0=nrow(tablestades)+1,
-					x1=as.numeric(as.POSIXct(trunc.POSIXt(dates[j],digits="day"))),
+					x1=as.numeric(as.POSIXct(Hmisc::trunc.POSIXt(dates[j],digits="day"))),
 					y1=nrow(tablestades)-j+1,
 					lty=3,
 					col="gray")

Modified: pkg/stacomir/R/Bilan_taille.r
===================================================================
--- pkg/stacomir/R/Bilan_taille.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/Bilan_taille.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -170,8 +170,8 @@
 	calcule(h$action)
 }
 #' Calcule method for BilanTaille
-#' @param h 
-#' @param ... 
+#' @param h A handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 setMethod("calcule",signature=signature("Bilan_taille"),definition=function(object) {
 			bilan_taille<-object
@@ -211,7 +211,7 @@
 
 #' fungraphInteract_tail uses the ggplot2usr interface to build the graphes
 #' @param h a handler
-#' @param ... 
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 fungraphInteract_tail = function(h,...) {
 	if(!exists(x="bilan_taille",envir=envir_stacomi)) {
@@ -234,8 +234,8 @@
 	
 #
 #' function used to display a table of the data
-#' @param h 
-#' @param ... 
+#' @param h a handler
+#' @param ... Additional parameters
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 	funtableBilan_tail = function(h,...) {
 		bilan_taille=charge(bilan_taille)

Modified: pkg/stacomir/R/PasdeTemps.r
===================================================================
--- pkg/stacomir/R/PasdeTemps.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/PasdeTemps.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,17 +1,3 @@
-# Nom fichier :        PasdeTemps (classe)
-# Projet :             controle migrateur
-# Organisme :          IAV
-# Auteur :             Cedric Briand
-# Contact :            cedric.briand"at"eptb-vilaine.fr
-# Date de creation :  31/03/2008 17:21:25
-# Compatibilite :
-# Etat :               developpement
-# Description          calcul et affichage des pas de temps (classe object)
-#**********************************************************************
-#*
-
-
-
 UNE_SECONDE     = as.difftime(c("0:0:1")) ;
 UNE_MINUTE      = 60 * UNE_SECONDE ;
 DIX_MINUTES     = 10 * UNE_MINUTE ;
@@ -95,7 +81,7 @@
 setClass(Class="PasDeTemps",representation=
 				representation(dateDebut="POSIXlt",stepDuration="numeric",nbStep="numeric",noPasCourant="integer"),
 		validity=validite_PasDeTemps,
-		prototype=prototype(dateDebut=as.POSIXlt(trunc.POSIXt(Sys.time(),"year")),
+		prototype=prototype(dateDebut=as.POSIXlt(Hmisc::trunc.POSIXt(Sys.time(),"year")),
 				stepDuration=as.numeric(86400),
 				nbStep=as.numeric(1),
 				noPasCourant=as.integer(0) ) )
@@ -177,7 +163,7 @@
 			CurrentDateDebut=object at dateDebut+ object at stepDuration*object at noPasCourant
 			# bug cht heure
 			if (object at stepDuration==86400) {
-				CurrentDateDebut=round.POSIXt(CurrentDateDebut,"days")
+				CurrentDateDebut=Hmisc::round.POSIXt(CurrentDateDebut,"days")
 			}			
 			return(CurrentDateDebut)
 		})
@@ -191,7 +177,7 @@
 			CurrentDateFin=object at dateDebut+ object at stepDuration*(object at noPasCourant+as.integer(1))
 			# bug cht heure 
 			if (object at stepDuration==86400) {
-				CurrentDateFin=round.POSIXt(CurrentDateFin,"days")
+				CurrentDateFin=Hmisc::round.POSIXt(CurrentDateFin,"days")
 			}
 			return(CurrentDateFin)
 		})

Modified: pkg/stacomir/R/data.r
===================================================================
--- pkg/stacomir/R/data.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/data.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -29,4 +29,19 @@
 #'   \item{time.sequence}{A time sequence generated for the bilan, used internally by the object}
 #' }
 #' @keywords data
-"bMM_Arzal"
\ No newline at end of file
+"bMM_Arzal"
+
+#' Messages
+#' 
+#' In english
+#'
+#' 
+#' @keywords data
+"msg"
+
+#' Working environment for stacomiR created when launching stacomi()
+#' 
+#' This is where the graphical interface stores its objects
+#' try \code{ls{envir=envir_stacomi)}
+#' @keywords environment
+"envir_stacomi"
\ No newline at end of file

Modified: pkg/stacomir/R/fungraph.r
===================================================================
--- pkg/stacomir/R/fungraph.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/fungraph.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -5,12 +5,15 @@
 #' 
 #' @usage fungraph(bilanMigration, tableau, time.sequence, taxon, stade, dc,...)
 #' @param bilanMigration An object of class \code{\linkS4class{BilanMigration}}
-#' @param table=tableau A data frame with the results
+#' @param table=tableau A data frame with the with the following columns : No.pas,debut_pas,fin_pas,              
+#' ope_dic_identifiant,lot_tax_code,lot_std_code,type_de_quantite,MESURE,CALCULE,               
+#' EXPERT,PONCTUEL,Effectif_total,taux_d_echappement,coe_valeur_coefficient
+#' @note this function is intended to be called from the plot method in BilanMigrationMult and BilanMigration
 #' @param time.sequence A vector POSIXt
 #' @param taxon The species
 #' @param stade The stage
 #' @param dc The DC
-#' @param ... other parameters passed but not used
+#' @param ... other parameters passed from the plot method to the matplot function
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 fungraph=function(bilanMigration,tableau,time.sequence,taxon,stade,dc=NULL,...){
 #mat <- matrix(1:6,3,2)

Modified: pkg/stacomir/R/fungraph_civelle.r
===================================================================
--- pkg/stacomir/R/fungraph_civelle.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/fungraph_civelle.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -11,7 +11,8 @@
 #' @param time.sequence a vector POSIXt
 #' @param taxon the species
 #' @param stade the stage
-#' @param dc the dc, default to null, only necessary for \code{\linkS4class{BilanMigrationMult}}
+#' @param dc the counting device, default to null, only necessary for \code{\linkS4class{BilanMigrationMult}}
+#' @param ... additional parameters passed from the plot method to plot
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 fungraph_civelle=function(bilanMigration,table,time.sequence,taxon,stade,dc=null,...){
 # calcul des variables

Modified: pkg/stacomir/R/fungraph_env.r
===================================================================
--- pkg/stacomir/R/fungraph_env.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/fungraph_env.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,11 +1,3 @@
-# Nom fichier :        fungraph_env.R
-
-
-
-
-
-
-
 #' Function for class BilanMigrationEnv drawing both the response of
 #' environment variables...
 #' 

Modified: pkg/stacomir/R/funtable.r
===================================================================
--- pkg/stacomir/R/funtable.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/funtable.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,12 +1,14 @@
-#' function to print and save statistics in .csv and .html formats
-#' @param tableau 
-#' @param time.sequence 
-#' @param taxon 
-#' @param stade 
-#' @param DC 
-#' @param resum 
+#' function to print and save statistics in .csv and .html formats for BilanMigration and BilanMigrationMult class
+#' @param tableau A table with the following columns : No.pas,debut_pas,fin_pas,              
+#' ope_dic_identifiant,lot_tax_code,lot_std_code,type_de_quantite,MESURE,CALCULE,               
+#' EXPERT,PONCTUEL,Effectif_total,taux_d_echappement,coe_valeur_coefficient
+#' @note this function is intended to be called from within the summary method 
+#' @param time.sequence Passed from BilanMigration or BilanMigrationMult
+#' @param taxon  Taxa
+#' @param stade The Stage
+#' @param DC  The counting device
+#' @param resum A summary table generated by funstat
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @export
 funtable=function(tableau,time.sequence,taxon,stade,DC,resum){
 	annee=unique(strftime(as.POSIXlt(time.sequence),"%Y"))
 	path1=file.path(path.expand(get("datawd",envir=envir_stacomi)),paste(DC,"_",taxon,"_",stade,"_",annee,".csv",sep=""),fsep ="/")

Modified: pkg/stacomir/R/funtraitement_poids.r
===================================================================
--- pkg/stacomir/R/funtraitement_poids.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/funtraitement_poids.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,17 +1,7 @@
-# Nom fichier :        funtraitement_poids
-# Projet :             calmig/prog/fonctions
-# Organisme :          IAV/CSP
-# Auteur :             Cedric Briand
-# Contact :            cedric.briand"at"eptb-vilaine.fr
-# Date de creation :   17 mai 2004
-# Compatibilite :      R 2.8.0
-# Etat :               OK
-# Description           tansformation des donnees de poids en nombre
-
 #' returns a table where weights and number are calculated from number and weights respectively
 #' performs a query to collect the conversion coefficients
-#' @param tableau 
-#' @param time.sequence 
+#' @param tableau A table passed BilanMigration
+#' @param time.sequence Time sequence passed from BilanMigration
 #' @return tableau
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @export

Modified: pkg/stacomir/R/interface_BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/interface_BilanMigrationMult.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/interface_BilanMigrationMult.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -37,7 +37,7 @@
 	# getStockIcons()
 	toolbarlist = list(
 			Calc=gWidgets::gaction(handler=hbilanMigrationMultcalc, action=bilanMigrationMult, icon="new", label="calcul", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.2),
-			Graph=gWidgets::gaction(handler=hbilanMigrationMult_graphe, icon="graph", label="graph", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.3),
+			Graph=gWidgets::gaction(handler=hbilanMigrationMult_graph, icon="graph", label="graph", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.3),
 			Graph2=gWidgets::gaction(handler=hbilanMigrationMultgraph2, icon="graph2", label="grcum", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.4),
 			Graph3=gWidgets::gaction(handler=hbilanMigrationMultgraph3, icon="gWidgetsRGtk2-barplot", label="gr(tous)", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.3),
 			Stat=gWidgets::gaction(handler=hTableBilanMigrationMult, icon="dataframe", label="stat", tooltip=get("msg",envir=envir_stacomi)$interface_BilanMigration.5),    

Modified: pkg/stacomir/R/stacomi.r
===================================================================
--- pkg/stacomir/R/stacomi.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/stacomi.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -280,7 +280,8 @@
 #' @export
 stacomi=function(gr_interface=TRUE,login_window=TRUE,pre_launch_test=TRUE){
 	# first loading of connection and odbc info using chargexml()
-	envir_stacomi <<- new.env(parent = emptyenv())
+	envir_stacomi <- new.env(parent = emptyenv())
+	assign("envir_stacomi",envir_stacomi,.GlobalEnv)
 	assign("gr_interface",gr_interface,envir=envir_stacomi)	
 	assign("pre_launch_test",pre_launch_test,envir=envir_stacomi)
 	assign("login_window",login_window,envir=envir_stacomi)
@@ -454,9 +455,11 @@
 				"col.sortie","ggroupboutons","ggroupboutonsbas","groupdate","groupdc","graphes",
 				"frame_annee","frame_check","frame_choice","frame_par","frame_parqual","frame_parquan",
 				"frame_std","frame_tax","frame_annee","frame_check","frame_choice",
-				"logw","bilan_stades_pigm","usrname","usrpwd","notebook"))
+				"logw","bilan_stades_pigm","usrname","usrpwd","notebook","values","ind"))
 # Progressbar
 utils::globalVariables(c("progres"))
+# environment
+utils::globalVariables(c("envir_stacomi"))
 # reoxygenize fails if data are not loaded
 #setwd("F:/workspace/stacomir/branch0.5/stacomir")
 #data("bMM_Arzal")

Modified: pkg/stacomir/R/utilitaires.r
===================================================================
--- pkg/stacomir/R/utilitaires.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/R/utilitaires.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,189 +1,3 @@
-# Nom fichier :        utilitaires.R
-# Projet :             stacomiR
-
-
-#############################################
-# functions copied from Hmisc
-#############################################
-
-
-
-
-
-
-#' monthDays function imported from depuis Hmisc that cannot be loaded for
-#' reasons of compatibility with xtable
-#' 
-#' monthDays function imported from depuis Hmisc
-#' 
-#' 
-#' @param time A POSIXt or Date object describing the month or year in question
-#' @author Charles Dupont
-monthDays<-
-		function (time) 
-{
-	time <- as.POSIXlt(time)
-	time$mday[] <- time$sec[] <- time$min <- time$hour <- 0
-	time$mon <- time$mon + 1
-	return(as.POSIXlt(as.POSIXct(time))$mday)
-}
-#' round.POSIXT function imported from  Hmisc that cannot be loaded
-#' @param x 
-#' @param digits 
-#' @return a rounded time value
-#' @author Charles Dupont
-round.POSIXt<-function (x, digits = c("secs", "mins", "hours", "days", "months", 
-				"years"),...) 
-{
-	if (is.numeric(digits) && digits == 0) 	digits <- "secs"
-	units <- match.arg(digits)
-	month.length <- monthDays(x)
-	x <- as.POSIXlt(x)
-	if (length(x$sec) > 0) 
-		switch(units, secs = {
-					x$sec <- x$sec
-				}, mins = {
-					x$sec <- x$sec + 30
-				}, hours = {
-					x$sec <- 0
-					x$min <- x$min + 30
-				}, days = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- x$hour + 12
-					isdst <- x$isdst <- -1
-				}, months = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- x$mday + trunc(monthDays(x)/2)
-					isdst <- x$isdst <- -1
-				}, years = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- 0
-					x$mon <- x$mon + 6
-					isdst <- x$isdst <- -1
-				})
-	return(trunc(as.POSIXct(x), digits = units))
-}
-
-
-
-
-#' trunc.POSIXt function copied from Hmisc that cannot be
-#' loaded in Rforge
-#' 
-#' 
-#' @param x Date to be floored, ceilinged, truncated, or rounded
-#' @param digits Unit to that is is rounded up or down to, called digit for
-#' compatibility with round or trunc generic method
-#' @param \dots Further arguments to be passed to or from other methods
-#' @return An object of class POSIXlt.
-#' @author Charles Dupont
-trunc.POSIXt<-function (x, digits = c("secs", "mins", "hours", "days", "months", 
-				"years"), ...) 
-{
-	#UseMethod("trunc.POSIXt")
-	units <- match.arg(digits)
-	x <- as.POSIXlt(x)
-	isdst <- x$isdst
-	if (length(x$sec) > 0) 
-		switch(units, secs = {
-					x$sec <- trunc(x$sec)
-				}, mins = {
-					x$sec <- 0
-				}, hours = {
-					x$sec <- 0
-					x$min <- 0
-				}, days = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					isdst <- x$isdst <- -1
-				}, months = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- 1
-					isdst <- x$isdst <- -1
-				}, years = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- 1
-					x$mon <- 0
-					isdst <- x$isdst <- -1
-				})
-	x <- as.POSIXlt(as.POSIXct(x))
-	if (isdst == -1) {
-		x$isdst <- -1
-	}
-	return(x)
-}
-#' ceil.POSIXT function imported from depuis Hmisc that cannot be loaded 
-#' 
-#' 
-#' @param x A POSIXt
-#' @param digits 
-#' @return a truncated time value
-#' @author Charles Dupont
-ceil.POSIXt<-function (x, digits = c("secs", "mins", "hours", "days", "months", 
-				"years"), ...) 
-{
-	units <- match.arg(digits)
-	x <- as.POSIXlt(x)
-	isdst <- x$isdst
-	if (length(x$sec) > 0 && x != trunc.POSIXt(x, digits = units)) {
-		switch(units, secs = {
-					x$sec <- ceiling(x$sec)
-				}, mins = {
-					x$sec <- 0
-					x$min <- x$min + 1
-				}, hours = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- x$hour + 1
-				}, days = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- x$mday + 1
-					isdst <- x$isdst <- -1
-				}, months = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- 1
-					x$mon <- x$mon + 1
-					isdst <- x$isdst <- -1
-				}, years = {
-					x$sec <- 0
-					x$min <- 0
-					x$hour <- 0
-					x$mday <- 1
-					x$mon <- 0
-					x$year <- x$year + 1
-					isdst <- x$isdst <- -1
-				})
-		x <- as.POSIXlt(as.POSIXct(x))
-		if (isdst == -1) {
-			x$isdst <- -1
-		}
-	}
-	return(x)
-}
-
-###########################################
-# functions used by the graphical interface
-#############################################
-
-
-
-
-
-
 #' function used to clean the objects whithin the group and the graphes and
 #' also elements remaining in the envir_stacomi environment
 #' 

Modified: pkg/stacomir/inst/config/stacomi_manual_launch.r
===================================================================
--- pkg/stacomir/inst/config/stacomi_manual_launch.r	2016-08-24 18:53:15 UTC (rev 178)
+++ pkg/stacomir/inst/config/stacomi_manual_launch.r	2016-08-24 19:57:35 UTC (rev 179)
@@ -1,20 +1,7 @@
-# Nom fichier :        stacomi 
-# Projet :             controle migrateur 
-# Organisme :          IAV/ONEMA
-# Auteur :             Cedric Briand
-# Contact :            cedric.briand"at"eptb-vilaine.fr
-# Date de creation :   11/04/2006 15:51:44
-# Compatibilite :      PostgreSQL 8.4
-#                      R 2.10.1                                        
-# Etat :               fonctionne 
-# Description          interface principale, fonction de lancement
-#                      chargement des librairies
-#**********************************************************************
-# initiation des parametres en fonctions des utilisateurs
+
 rm(list=ls(all=TRUE))
-# les donnees sont stockees dans un fichier xml stocke dans le repertoire par defaut,
-# ce fichier peut etre edite pour modifier des parametres
 
+
 ## lancement du programme proprement dit
 #  if (exists("group")) {rm(group)}
 #  if (exists("graphes")) {rm(graphes) }



More information about the Stacomir-commits mailing list