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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 17 16:36:56 CET 2017


Author: legrand
Date: 2017-03-17 16:36:55 +0100 (Fri, 17 Mar 2017)
New Revision: 312

Modified:
   pkg/stacomir/R/BilanAgedemer.r
Log:


Modified: pkg/stacomir/R/BilanAgedemer.r
===================================================================
--- pkg/stacomir/R/BilanAgedemer.r	2017-03-17 14:58:02 UTC (rev 311)
+++ pkg/stacomir/R/BilanAgedemer.r	2017-03-17 15:36:55 UTC (rev 312)
@@ -363,10 +363,27 @@
 					host=get("sqldf.options",envir=envir_stacomi)["sqldf.host"]
 					port=get("sqldf.options",envir=envir_stacomi)["sqldf.port"]		
 					
-					if (class(bilan_adm)!="BilanAgedemer") stop("the bilanMigration should be of class BilanMigration")
+					if (class(bilan_adm)!="BilanAgedemer") stop("the bilan_adm should be of class BilanAgedemer")
 					if (class(silent)!="logical") stop("the silent argument should be a logical")
-					dc=as.numeric(bilanMigration at dc@dc_selectionne)[1]
-					data=bilanMigration at calcdata[[stringr::str_c("dc_",dc)]][["data"]]
+					dc=as.numeric(bilan_adm at dc@dc_selectionne)[1]
+					if (bilan_adm at calcdata[[stringr::str_c("dc_",dc)]][["data"]]!=NULL){
+						#TO DO lancer méthode supprime
+					} else {
+					code_parametre_age=124	
+					code_methode_obtention="METHODE"
+					precision=1
+						bilanAgedemer_bam=cbind(
+								bilan_adm at calcdata$data$lot_identifiant, 
+								rep(code_parametre_age,nrow(bilan_adm at calcdata$data)),
+								rep(code_methode_obtention,nrow(bilan_adm at calcdata$data)),
+								NULL,
+								bilan_adm at calcdata$data$age,
+								rep(precision,nrow(bilan_adm at calcdata$data)),
+								NULL,
+								substr(toupper(get("sch",envir=envir_stacomi)),1,nchar(toupper(get("sch",envir=envir_stacomi)))-1)
+						)
+					}
+					data=bilan_adm at calcdata[[stringr::str_c("dc_",dc)]][["data"]]
 					data=data[data$Effectif_total!=0,]
 					jour_dans_lannee_non_nuls=data$debut_pas	
 					col_a_retirer=match(c("No.pas","type_de_quantite","debut_pas","fin_pas"),colnames(data))



More information about the Stacomir-commits mailing list