[Stacomir-commits] r207 - in pkg/stacomir: R examples/01_BilanMigrationMult inst/tests/testthat

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Sep 11 21:21:54 CEST 2016


Author: briand
Date: 2016-09-11 21:21:54 +0200 (Sun, 11 Sep 2016)
New Revision: 207

Modified:
   pkg/stacomir/R/BilanMigration.r
   pkg/stacomir/R/funtable.r
   pkg/stacomir/examples/01_BilanMigrationMult/bilanMigrationMult_Arzal.R
   pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R
Log:


Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r	2016-09-11 18:27:39 UTC (rev 206)
+++ pkg/stacomir/R/BilanMigration.r	2016-09-11 19:21:54 UTC (rev 207)
@@ -363,7 +363,7 @@
 							#----------------------------------
 							# bilan migration avec poids (civelles
 							#-----------------------------------------
-							grDevices::X11()
+							#grDevices::X11()
 							fungraph_civelle(bilanMigration=bilanMigration,
 									table=data_without_hole,
 									time.sequence=bilanMigration at time.sequence,
@@ -377,7 +377,7 @@
 							#----------------------------------
 							# bilan migration standard
 							#-----------------------------------------
-							grDevices::X11()
+							#grDevices::X11()
 							#silent=TRUE
 							fungraph(bilanMigration=bilanMigration,
 									tableau=data_without_hole,

Modified: pkg/stacomir/R/funtable.r
===================================================================
--- pkg/stacomir/R/funtable.r	2016-09-11 18:27:39 UTC (rev 206)
+++ pkg/stacomir/R/funtable.r	2016-09-11 19:21:54 UTC (rev 207)
@@ -28,11 +28,8 @@
 	if (!silent) funout(paste("ecriture de",path1html,"\n"))
 	if( !is.null(resum) )
 	{
-		path2=file.path(path.expand(get("datawd",envir=envir_stacomi)),paste("res",annee,".csv",sep=""),fsep ="/")
-		# warning that it is appending column name to file
-		options(warn = 2)
-		write.table(resum,path2,row.names=TRUE,col.names=TRUE,sep=";",append=TRUE)
-		options(warn = 0)
+		path2=file.path(path.expand(get("datawd",envir=envir_stacomi)),paste("res",DC,"_",taxon,"_",stade,"_",annee,".csv",sep=""),fsep ="/")
+		write.table(resum,path2,row.names=TRUE,col.names=TRUE,sep=";")
 		path2html=file.path(path.expand(get("datawd",envir=envir_stacomi)),paste("res",annee,".html",sep=""),fsep ="/")
 		if (!silent) funout(paste(get("msg",envir=envir_stacomi)$funtable.1,path2,"\n"))
 		funhtml(data=resum,

Modified: pkg/stacomir/examples/01_BilanMigrationMult/bilanMigrationMult_Arzal.R
===================================================================
--- pkg/stacomir/examples/01_BilanMigrationMult/bilanMigrationMult_Arzal.R	2016-09-11 18:27:39 UTC (rev 206)
+++ pkg/stacomir/examples/01_BilanMigrationMult/bilanMigrationMult_Arzal.R	2016-09-11 19:21:54 UTC (rev 207)
@@ -28,10 +28,14 @@
 bMM_Arzal<-calcule(bMM_Arzal,silent=TRUE)
 #Individual plot for all DC, taxon and stage where data present
 #Silent=TRUE to turn off messages
+# not run because of multiple graphical devices
+\dontrun{
 plot(bMM_Arzal,plot.type="standard",silent=TRUE)
+}
+#cumulated migration at the station (all stages and DC grouped)
 
-#cumulated migration at the station (all stages and DC grouped)
 plot(bMM_Arzal,plot.type="step")
+
 #some plots are a mixture of french and english
 #changing the reference table names to english should shift all to english.
 #same for spanish.

Modified: pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R
===================================================================
--- pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R	2016-09-11 18:27:39 UTC (rev 206)
+++ pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R	2016-09-11 19:21:54 UTC (rev 207)
@@ -51,3 +51,11 @@
 			if (test!=0) warnings("Package example dir not created ?") else
 				source(example_path)
 		})
+
+test_that("Test plot method standard",
+		{
+			stacomi(gr_interface=FALSE,login_window=FALSE,database_expected=FALSE) 
+			data("bMM_Arzal")
+			bMM_Arzal<-calcule(bMM_Arzal,silent=TRUE)
+			plot(bMM_Arzal,plot.type="standard",silent=TRUE)
+		})



More information about the Stacomir-commits mailing list