[Stacomir-commits] r192 - in pkg/stacomir: . R inst/tests/testthat man vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Sep 5 21:24:01 CEST 2016


Author: briand
Date: 2016-09-05 21:24:01 +0200 (Mon, 05 Sep 2016)
New Revision: 192

Removed:
   pkg/stacomir/vignettes/vignette_stacomi.aux
Modified:
   pkg/stacomir/NAMESPACE
   pkg/stacomir/R/BilanMigration.r
   pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
   pkg/stacomir/man/BilanMigration-class.Rd
   pkg/stacomir/man/fn_EcritBilanJournalier.Rd
   pkg/stacomir/man/fn_EcritBilanMensuel.Rd
   pkg/stacomir/man/plot-BilanMigration-ANY-method.Rd
Log:


Modified: pkg/stacomir/NAMESPACE
===================================================================
--- pkg/stacomir/NAMESPACE	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/NAMESPACE	2016-09-05 19:24:01 UTC (rev 192)
@@ -13,6 +13,7 @@
 export(fundensityBilan_carlot)
 export(funout)
 export(funpointBilan_carlot)
+export(funstat)
 export(funtableBilan_carlot)
 export(funtableDF)
 export(funtraitement_poids)

Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/R/BilanMigration.r	2016-09-05 19:24:01 UTC (rev 192)
@@ -357,7 +357,7 @@
 			} else if (plot.type=="step"){
 				taxon= as.character(bilanMigration at taxons@data$tax_nom_latin)
 				stade= as.character(bilanMigration at stades@data$std_libelle)
-				DC=as.numeric(bilanMigration at dc@dc_selectionne)	
+				dc=as.numeric(bilanMigration at dc@dc_selectionne)	
 				if (bilanMigration at pasDeTemps@stepDuration==86400 & bilanMigration at pasDeTemps@stepDuration==86400) {
 					grdata<-bilanMigration at calcdata[[stringr::str_c("dc_",dc)]][["data"]]
 					grdata<-funtraitementdate(grdata,

Modified: pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
===================================================================
--- pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R	2016-09-05 19:24:01 UTC (rev 192)
@@ -60,5 +60,18 @@
 
 test_that("Test writing an example to the database",
 		{
-			
+			stacomi(gr_interface=FALSE,
+					login_window=FALSE,
+					database_expected=TRUE)	
+			# overriding user schema
+			baseODBC<-get("baseODBC",envir=envir_stacomi)
+			baseODBC[c(2,3)]<-rep("iav",2)
+			assign("baseODBC",baseODBC,envir_stacomi)
+			sch<-get("sch",envir=envir_stacomi) # "iav."
+			assign("sch","iav.",envir_stacomi)
+			# this chunk is not launched from examples but loads the bM_Arzal dataset if connection works	
+			data("bM_Arzal")
+			bM_Arzal<-calcule(bM_Arzal)
+			fn_EcritBilanJournalier(bilanMigration=bM_Arzal,silent=FALSE)
+			rm("envir_stacomi",envir =.GlobalEnv)
 		})
\ No newline at end of file

Modified: pkg/stacomir/man/BilanMigration-class.Rd
===================================================================
--- pkg/stacomir/man/BilanMigration-class.Rd	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/man/BilanMigration-class.Rd	2016-09-05 19:24:01 UTC (rev 192)
@@ -64,6 +64,8 @@
 bM_Arzal<-calcule(bM_Arzal)
 #Individual plot for all DC (standard), taxon and stage where data present
 #silent argument to stop all messages
+# this will also write daily and monthly migration balance to the database,
+# but only if stacomi has been run with argument : database_expected=FALSE
 plot(bM_Arzal,plot.type="standard",silent=TRUE)
 
 #cumulated migration at the station (all stages and DC grouped)

Modified: pkg/stacomir/man/fn_EcritBilanJournalier.Rd
===================================================================
--- pkg/stacomir/man/fn_EcritBilanJournalier.Rd	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/man/fn_EcritBilanJournalier.Rd	2016-09-05 19:24:01 UTC (rev 192)
@@ -5,10 +5,12 @@
 \title{fn_EcritBilanJournier writes the daily migration in the
 t_bilanmigrationjournalier_bjo table}
 \usage{
-fn_EcritBilanJournalier(bilanMigration)
+fn_EcritBilanJournalier(bilanMigration, silent)
 }
 \arguments{
 \item{bilanMigration}{an object of class \code{\linkS4class{BilanMigration}}}
+
+\item{silent}{: TRUE to avoid messages}
 }
 \description{
 Daily values are needed to compare migrations from year to year, by the class \link{BilanMigrationInterAnnuelle-class}. They are added by
@@ -18,6 +20,14 @@
 the user is asked whether or not he wants to overwrite data, if no
 data are present in the database, the import is done anyway
 }
+\examples{
+\dontrun{
+stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE) 
+data("bM_Arzal")
+bM_Arzal<-calcule(bM_Arzal)
+fn_EcritBilanJournalier(bilanMigration=bM_Arzal,silent=FALSE)
+}
+}
 \author{
 Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 }

Modified: pkg/stacomir/man/fn_EcritBilanMensuel.Rd
===================================================================
--- pkg/stacomir/man/fn_EcritBilanMensuel.Rd	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/man/fn_EcritBilanMensuel.Rd	2016-09-05 19:24:01 UTC (rev 192)
@@ -12,6 +12,10 @@
 \item{resum}{data frame with summary per month}
 }
 \description{
-Launched by fun_EcritBilanJournalier
+This writes monthly data in t_bilanmensuel_mens table
 }
+\note{
+This function is launched by fun_EcritBilanJournalier, the resum 
+dataset is created by the \link{funstat} function
+}
 

Modified: pkg/stacomir/man/plot-BilanMigration-ANY-method.Rd
===================================================================
--- pkg/stacomir/man/plot-BilanMigration-ANY-method.Rd	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/man/plot-BilanMigration-ANY-method.Rd	2016-09-05 19:24:01 UTC (rev 192)
@@ -28,7 +28,8 @@
 }
 \note{
 When plotting the "standard" plot, the user will be prompted to "write" the daily migration and monthly migration in the database.
-these entries are necessary to run the Interannual Migration class.
+these entries are necessary to run the Interannual Migration class. If the stacomi has been launched with database_expected=FALSE,
+then no entry will be written to the database
 }
 \author{
 Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}

Deleted: pkg/stacomir/vignettes/vignette_stacomi.aux
===================================================================
--- pkg/stacomir/vignettes/vignette_stacomi.aux	2016-09-05 19:23:41 UTC (rev 191)
+++ pkg/stacomir/vignettes/vignette_stacomi.aux	2016-09-05 19:24:01 UTC (rev 192)
@@ -1,27 +0,0 @@
-\relax 
-\providecommand\hyper at newdestlabel[2]{}
-\bibstyle{jss}
-\providecommand\HyperFirstAtBeginDocument{\AtBeginDocument}
-\HyperFirstAtBeginDocument{\ifx\hyper at anchor\@undefined
-\global\let\oldcontentsline\contentsline
-\gdef\contentsline#1#2#3#4{\oldcontentsline{#1}{#2}{#3}}
-\global\let\oldnewlabel\newlabel
-\gdef\newlabel#1#2{\newlabelxx{#1}#2}
-\gdef\newlabelxx#1#2#3#4#5#6{\oldnewlabel{#1}{{#2}{#3}}}
-\AtEndDocument{\ifx\hyper at anchor\@undefined
-\let\contentsline\oldcontentsline
-\let\newlabel\oldnewlabel
-\fi}
-\fi}
-\global\let\hyper at last\relax 
-\gdef\HyperFirstAtBeginDocument#1{#1}
-\providecommand\HyField at AuxAddToFields[1]{}
-\providecommand\HyField at AuxAddToCoFields[2]{}
-\catcode `:\active 
-\catcode `;\active 
-\catcode `!\active 
-\catcode `?\active 
-\select at language{french}
-\@writefile{toc}{\select at language{french}}
-\@writefile{lof}{\select at language{french}}
-\@writefile{lot}{\select at language{french}}



More information about the Stacomir-commits mailing list