[Stacomir-commits] r468 - pkg/stacomir/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Dec 23 22:35:01 CET 2017


Author: briand
Date: 2017-12-23 22:35:01 +0100 (Sat, 23 Dec 2017)
New Revision: 468

Modified:
   pkg/stacomir/R/ref_timestep.R
   pkg/stacomir/R/report_mig_interannual.R
Log:
ceilPOSIXt and truncPOSIXt also changed in Hmisc

Modified: pkg/stacomir/R/ref_timestep.R
===================================================================
--- pkg/stacomir/R/ref_timestep.R	2017-12-23 17:44:10 UTC (rev 467)
+++ pkg/stacomir/R/ref_timestep.R	2017-12-23 21:35:01 UTC (rev 468)
@@ -78,7 +78,7 @@
 setClass(Class="ref_timestep",representation=
 		representation(dateDebut="POSIXlt",step_duration="numeric",nb_step="numeric",nocurrent_step="integer"),
 	validity=validity_ref_timestep,
-	prototype=prototype(dateDebut=as.POSIXlt(Hmisc::trunc.POSIXt(Sys.time(),"year")),
+	prototype=prototype(dateDebut=as.POSIXlt(Hmisc::truncPOSIXt(Sys.time(),"year")),
 		step_duration=as.numeric(86400),
 		nb_step=as.numeric(1),
 		nocurrent_step=as.integer(0) ) )

Modified: pkg/stacomir/R/report_mig_interannual.R
===================================================================
--- pkg/stacomir/R/report_mig_interannual.R	2017-12-23 17:44:10 UTC (rev 467)
+++ pkg/stacomir/R/report_mig_interannual.R	2017-12-23 21:35:01 UTC (rev 468)
@@ -760,8 +760,8 @@
 			g <- g+geom_bar(stat="identity",aes_string(ymin="valeur",ymax="valeur",col="comp"),fill=NA,width=0.6)
 			g <- g+geom_bar(stat="identity",aes_string(ymin="valeur",ymax="valeur",fill="comp"),alpha=0.5,width=0.6)
 			#g <- g+scale_x_date(name=paste("mois"),breaks="month",minor_breaks=getvalue(new("ref_period"),label=date_format("%b"),timesplit))
-			#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)) 
+			#lim=as.POSIXct(c(Hmisc::truncPOSIXt((min(tmp[tmp$com!="0",timesplit])),"month")-delai,
+			#				Hmisc::ceilPOSIXt((max(tmp[tmp$com!="0",timesplit])),"month")+delai)) 
 			# pb the limit truncs the value
 			g <- g+ylab("effectif")
 			cols <- c( "max" = "#000080",
@@ -906,7 +906,7 @@
 			g <- g+scale_x_datetime(name=paste("mois"),date_breaks="month",
 				date_minor_breaks=getvalue(new("ref_period"),timesplit),
 				date_labels="%b",
-				limits=as.POSIXct(c(Hmisc::trunc.POSIXt((min(dat[dat$valeur!=0,timesplit])),"month"),Hmisc::ceil.POSIXt((max(dat[dat$valeur!="0",timesplit])),"month")))) 
+				limits=as.POSIXct(c(Hmisc::truncPOSIXt((min(dat[dat$valeur!=0,timesplit])),"month"),Hmisc::ceilPOSIXt((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)



More information about the Stacomir-commits mailing list