[Stacomir-commits] r221 - in pkg/stacomir: R data inst/config inst/examples inst/tests/testthat man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 28 13:32:30 CEST 2016
Author: briand
Date: 2016-09-28 13:32:30 +0200 (Wed, 28 Sep 2016)
New Revision: 221
Added:
pkg/stacomir/data/bilanFonctionnementDC_bM.rda
pkg/stacomir/data/bilanFonctionnementDF_bM.rda
pkg/stacomir/data/bilanOperation_bM.rda
pkg/stacomir/man/bilanFonctionnementDC.Rd
pkg/stacomir/man/bilanFonctionnementDF.Rd
pkg/stacomir/man/bilanOperation.Rd
Modified:
pkg/stacomir/R/BilanMigration.r
pkg/stacomir/R/BilanMigrationInterAnnuelle.r
pkg/stacomir/R/BilanMigrationMult.r
pkg/stacomir/R/BilanMigrationPar.r
pkg/stacomir/R/Bilan_carlot.r
pkg/stacomir/R/Bilan_taille.r
pkg/stacomir/R/PasDeTempsJournalier.r
pkg/stacomir/R/RefDF.r
pkg/stacomir/R/RefHorodate.r
pkg/stacomir/R/RefStades.r
pkg/stacomir/R/RefTaxon.r
pkg/stacomir/R/fungraph_civelle.r
pkg/stacomir/R/funstat.r
pkg/stacomir/R/funtable.r
pkg/stacomir/data/bMM_Arzal.rda
pkg/stacomir/data/bM_Arzal.rda
pkg/stacomir/data/bilanFonctionnementDC.rda
pkg/stacomir/data/bilanFonctionnementDF.rda
pkg/stacomir/data/bilanOperation.rda
pkg/stacomir/inst/config/generate_data.R
pkg/stacomir/inst/config/testthat.R
pkg/stacomir/inst/examples/bilanMigration_Arzal.R
pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R
pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
pkg/stacomir/man/BilanMigration-class.Rd
pkg/stacomir/man/charge-BilanMigration-method.Rd
pkg/stacomir/man/connect-BilanMigration-method.Rd
Log:
Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/BilanMigration.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -81,12 +81,13 @@
#'
#' uses the BilanMigrationMult method
#' @param object An object of class \link{BilanMigration-class}
+#' @param silent Boolean default FALSE, if TRUE information messages not displayed
#' @return BilanMigration with slot @data filled from the database
#' @export
-setMethod("connect",signature=signature("BilanMigration"),definition=function(object){
+setMethod("connect",signature=signature("BilanMigration"),definition=function(object,silent=FALSE){
bilanMigration<-object
bilanMigrationMult<-as(bilanMigration,"BilanMigrationMult")
- bilanMigrationMult<-connect(bilanMigrationMult)
+ bilanMigrationMult<-connect(bilanMigrationMult,silent=silent)
bilanMigration at data<-bilanMigrationMult at data
return(bilanMigration)
})
@@ -116,41 +117,13 @@
bilanMigration at stades<-charge_avec_filtre(object=bilanMigration at stades,bilanMigration at dc@dc_selectionne,bilanMigration at taxons@data$tax_code)
bilanMigration at stades<-choice_c(bilanMigration at stades,stades)
bilanMigration at pasDeTemps<-choice_c(bilanMigration at pasDeTemps,datedebut,datefin)
-
- #################################
- # loading data for other classes associated with bilanMigrationMult
- #################################
- bilanFonctionnementDF=new("BilanFonctionnementDF")
- bilanFonctionnementDC=new("BilanFonctionnementDC")
- bilanOperation=new("BilanOperation")
- dc<-bilanMigration at dc@dc_selectionne
- df<-bilanMigration at dc@data$df[bilanMigration at dc@data$dc%in%dc]
- refDF=new("RefDF")
- refDF<-choice_c(refDF,df)
- assign("refDF",refDF,envir=envir_stacomi)
- assign("bilanFonctionnementDC_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
- assign("bilanFonctionnementDC_date_fin",as.POSIXlt(DateFin(get("pasDeTemps",envir_stacomi))),envir_stacomi)
- bilanFonctionnementDC<-charge(bilanFonctionnementDC)
-
- assign("bilanFonctionnementDF_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
- assign("bilanFonctionnementDF_date_fin",as.POSIXlt(DateFin(get("pasDeTemps",envir_stacomi))),envir_stacomi)
- bilanFonctionnementDF<-charge(bilanFonctionnementDF)
-
- ssign("bilanOperation_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
- assign("bilanOperation_date_fin",as.POSIXlt(DateFin(get("pasDeTemps",envir_stacomi))),envir_stacomi)
- bilanOperation<-charge(bilanOperation)
-
- assign("bilanFonctionnementDF",bilanFonctionnementDF,envir=envir_stacomi)
- assign("bilanFonctionnementDC",bilanFonctionnementDC,envir=envir_stacomi)
- assign("bilanOperation",bilanOperation,envir=envir_stacomi)
- stopifnot(validObject(bilanMigration, test=TRUE))
- assign("bilanMigration",bilanMigration,envir = envir_stacomi)
return(bilanMigration)
})
#' charge method for BilanMigration
#'
-#' fills also the data slot by the connect method
+#' this method creates additional classes in envir_stacomi for later use in plot (operations,
+#' DF operation, DC operation.
#' @param object An object of class \code{\link{BilanMigration-class}}
#' @param silent Should the program be returning messages
#' @return An object of class \link{BilanMigration-class} with slots filled by user choice
@@ -158,6 +131,7 @@
#' @export
setMethod("charge",signature=signature("BilanMigration"),definition=function(object,silent=FALSE){
bilanMigration<-object
+ #bilanMigration<-bM_Arzal
#pour l'instant ne lancer que si les fenetre sont fermees
# funout("lancement updateplot \n")
if (exists("refDC",envir_stacomi)) {
@@ -167,8 +141,8 @@
} else {
funout(get("msg",envir_stacomi)$ref.1,arret=TRUE)
}
- if (exists("refTaxons",envir_stacomi)) {
- bilanMigration at taxons<-get("refTaxons",envir_stacomi)
+ if (exists("refTaxon",envir_stacomi)) {
+ bilanMigration at taxons<-get("refTaxon",envir_stacomi)
} else {
funout(get("msg",envir_stacomi)$ref.2,arret=TRUE)
}
@@ -185,12 +159,13 @@
funout(get("msg",envir=envir_stacomi)$BilanMigration.1,arret=FALSE)
warning(get("msg",envir=envir_stacomi)$BilanMigration.1)
}
- bilanMigration=connect(bilanMigration)
- if (!silent) cat(stringr::str_c("data collected from the database nrow=",nrow(bilanMigration at data),"\n"))
- stopifnot(validObject(bilanMigration, test=TRUE))
+
#################################
# loading data for other classes associated with bilanMigrationMult
#################################
+ bilanFonctionnementDF=new("BilanFonctionnementDF")
+ bilanFonctionnementDC=new("BilanFonctionnementDC")
+ bilanOperation=new("BilanOperation")
assign("bilanFonctionnementDC_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
assign("bilanFonctionnementDC_date_fin",as.POSIXlt(DateFin(get("pasDeTemps",envir_stacomi))),envir_stacomi)
assign("bilanFonctionnementDF_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
@@ -198,18 +173,18 @@
assign("bilanOperation_date_debut",get("pasDeTemps",envir_stacomi)@"dateDebut",envir_stacomi)
assign("bilanOperation_date_fin",as.POSIXlt(DateFin(get("pasDeTemps",envir_stacomi))),envir_stacomi)
- bilanOperation<-get("bilanOperation",envir=envir_stacomi)
bilanOperation<-charge(bilanOperation)
# charge will search for refDC (possible multiple choice), bilanOperation_date_debut
# and bilanOperation_date_fin in envir_stacomi
- bilanFonctionnementDC<-get("bilanFonctionnementDC", envir=envir_stacomi)
- # charge will search for refDC (possible multiple choice), bilanFonctionnementDC_date_debut
+ # charge will search for refDC (possible multiple choice), bilanFonctionnementDC_date_debut
# and bilanFonctionnementDC_date_fin in envir_stacomi
bilanFonctionnementDC<-charge(bilanFonctionnementDC)
refDF=new("RefDF")
+ refDF<-charge(refDF)
refDF<-choice_c(refDF,df)
+
assign("refDF",refDF,envir=envir_stacomi)
- bilanFonctionnementDF<-get("bilanFonctionnementDF",envir=envir_stacomi)
+
# charge will search for refDF (possible multiple choice), bilanFonctionnementDF_date_debut
# and bilanFonctionnementDF_date_fin in envir_stacomi
bilanFonctionnementDF<-charge(bilanFonctionnementDF)
Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -139,8 +139,8 @@
} else {
funout(get("msg",envir_stacomi)$ref.1,arret=TRUE)
}
- if (exists("refTaxons",envir_stacomi)) {
- object at taxons<-get("refTaxons",envir_stacomi)
+ if (exists("refTaxon",envir_stacomi)) {
+ object at taxons<-get("refTaxon",envir_stacomi)
} else {
funout(get("msg",envir_stacomi)$ref.2,arret=TRUE)
}
Modified: pkg/stacomir/R/BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/BilanMigrationMult.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/BilanMigrationMult.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -294,7 +294,6 @@
req<-stacomirtools::connect(req)
bilanMigrationMult at data=req at query
if (!silent) cat(stringr::str_c("data collected from the database nrow=",nrow(bilanMigrationMult at data),"\n"))
- stopifnot(validObject(bilanMigrationMult, test=TRUE))
# recuperation des coefficients si il y a des civelles dans le bilan
if (2038%in%bilanMigrationMult at taxons@data$tax_code){
req=new("RequeteODBCwheredate")
@@ -310,6 +309,8 @@
bilanMigrationMult at coef_conversion<-req at query
}
+ stopifnot(validObject(bilanMigrationMult, test=TRUE))
+
#######################""
# connect method for associated classes
#########################
Modified: pkg/stacomir/R/BilanMigrationPar.r
===================================================================
--- pkg/stacomir/R/BilanMigrationPar.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/BilanMigrationPar.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -87,8 +87,8 @@
} else {
funout(get("msg",envir_stacomi)$ref.1,arret=TRUE)
}
- if (exists("refTaxons",envir_stacomi)) {
- bilanMigrationPar at taxons<-get("refTaxons",envir_stacomi)
+ if (exists("refTaxon",envir_stacomi)) {
+ bilanMigrationPar at taxons<-get("refTaxon",envir_stacomi)
} else {
funout(get("msg",envir_stacomi)$ref.2,arret=TRUE)
}
Modified: pkg/stacomir/R/Bilan_carlot.r
===================================================================
--- pkg/stacomir/R/Bilan_carlot.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/Bilan_carlot.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -89,8 +89,8 @@
} else {
funout(get("msg",envir_stacomi)$ref.1,arret=TRUE)
}
- if (exists("refTaxons",envir_stacomi)) {
- object at taxons<-get("refTaxons",envir_stacomi)
+ if (exists("refTaxon",envir_stacomi)) {
+ object at taxons<-get("refTaxon",envir_stacomi)
} else {
funout(get("msg",envir_stacomi)$ref.2,arret=TRUE)
}
Modified: pkg/stacomir/R/Bilan_taille.r
===================================================================
--- pkg/stacomir/R/Bilan_taille.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/Bilan_taille.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -137,8 +137,8 @@
} else {
funout(get("msg",envir=envir_stacomi)$ref.1,arret=TRUE)
}
- if (exists("refTaxons",envir_stacomi)) {
- object at taxons<-get("refTaxons",envir_stacomi)
+ if (exists("refTaxon",envir_stacomi)) {
+ object at taxons<-get("refTaxon",envir_stacomi)
} else {
funout(get("msg",envir=envir_stacomi)$ref.2,arret=TRUE)
Modified: pkg/stacomir/R/PasDeTempsJournalier.r
===================================================================
--- pkg/stacomir/R/PasDeTempsJournalier.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/PasDeTempsJournalier.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -143,7 +143,7 @@
}
}
object at dateDebut<-as.POSIXlt(datedebut)
- object at nbStep=as.numeric(difftime(datefin,datedebut,units="days")+1)
+ object at nbStep=as.numeric(difftime(datefin,datedebut,units="days")) # to fit with DateFin(object)
validObject(object)
assign("pasDeTemps",object,envir_stacomi)
return(object)
Modified: pkg/stacomir/R/RefDF.r
===================================================================
--- pkg/stacomir/R/RefDF.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/RefDF.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -144,6 +144,7 @@
#' choice_c(object=object,objectBilan=objectBilan,dc=1)
#' }
setMethod("choice_c",signature=signature("RefDF"),definition=function(object,df) {
+ #object<-refDF
if (class(df)=="numeric") {
df<-as.integer(df)
} else if (class(df)=="character"){
Modified: pkg/stacomir/R/RefHorodate.r
===================================================================
--- pkg/stacomir/R/RefHorodate.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/RefHorodate.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -169,7 +169,7 @@
object at horodate=.horodate
validObject(object)
assign(nomassign,object at horodate,envir_stacomi)
- funout(funoutlabel)
+ if (!silent) funout(funoutlabel)
return(object)
})
Modified: pkg/stacomir/R/RefStades.r
===================================================================
--- pkg/stacomir/R/RefStades.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/RefStades.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -98,20 +98,20 @@
# elle est alors affichee des le debut par la methode choice e laquelle on ne passe pas d'objectBilan en parametre
#il y a bien un object par dans l'object Bilan
if (class(try(objectBilan at par,silent=TRUE))!="try-error") {
- objectBilan at par<<-charge_avec_filtre(object=objectBilan at par,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
+ objectBilan at par<<-charge_avec_filtre(object=objectBilan at par,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
if (exists("frame_par")) delete(group,frame_par)
choice(objectBilan at par,is.enabled=TRUE)
}
#il y a bien un object parqual dans l'object Bilan
if (class(try(objectBilan at parqual,silent=TRUE))!="try-error") {
- objectBilan at parqual<<-charge_avec_filtre(object=objectBilan at parqual,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
+ objectBilan at parqual<<-charge_avec_filtre(object=objectBilan at parqual,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
if (exists("frame_parqual")) delete(group,frame_parqual)
choice(objectBilan at parqual,label=get("msg",envir=envir_stacomi)$RefStades.3,nomassign="refparqual",frameassign="frame_parqual",is.enabled=TRUE)
}
#il y a bien un object parquan dans l'object Bilan
if (class(try(objectBilan at parquan,silent=TRUE))!="try-error") {
- objectBilan at parquan<<-charge_avec_filtre(object=objectBilan at parquan,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
+ objectBilan at parquan<<-charge_avec_filtre(object=objectBilan at parquan,dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
if (class(objectBilan)=="Bilan_taille" )
{
if (nrow(objectBilan at parquan@data)>0) {
@@ -178,7 +178,7 @@
if (class(try(objectBilan at par,silent=TRUE))!="try-error") {
objectBilan at par<-charge_avec_filtre(object=objectBilan at par,
dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,
- taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,
+ taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,
stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
choicemult(objectBilan at par,is.enabled=TRUE)
}
@@ -186,7 +186,7 @@
if (class(try(objectBilan at parqual,silent=TRUE))!="try-error") {
objectBilan at parqual<-charge_avec_filtre(object=objectBilan at parqual,
dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,
- taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,
+ taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,
stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
choicemult(objectBilan at parqual,label=get("msg",envir=envir_stacomi)$RefStades.3,nomassign="refparqual",frameassign="frame_parqual",is.enabled=TRUE)
}
@@ -194,7 +194,7 @@
if (class(try(objectBilan at parquan,silent=TRUE))!="try-error") {
objectBilan at parquan<-charge_avec_filtre(object=objectBilan at parquan,
dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,
- taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code,
+ taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code,
stade_selectionne=get("refStades",envir_stacomi)@data$std_code)
if (class(objectBilan)=="Bilan_taille" )
{
Modified: pkg/stacomir/R/RefTaxon.r
===================================================================
--- pkg/stacomir/R/RefTaxon.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/RefTaxon.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -119,13 +119,13 @@
htax=function(h,...){
taxons=tbdesttaxon[,][tbdesttaxon[,]!=""]
object at data<-object at data[tax_libelle%in%taxons ,]
- assign("refTaxons",object,envir_stacomi)
+ assign("refTaxon",object,envir_stacomi)
funout(get("msg",envir=envir_stacomi)$RefTaxon.4)
if (!is.null(objectBilan)) {
objectBilan at taxons<-object
objectBilan at stades<-charge_avec_filtre(object=objectBilan at stades,
dc_selectionne=get("refDC",envir_stacomi)@dc_selectionne,
- taxon_selectionne=get("refTaxons",envir_stacomi)@data$tax_code
+ taxon_selectionne=get("refTaxon",envir_stacomi)@data$tax_code
)
assign(get("objectBilan",envir=envir_stacomi),objectBilan,envir=envir_stacomi)
# suppresses all tab larger than 3 (taxon)
Modified: pkg/stacomir/R/fungraph_civelle.r
===================================================================
--- pkg/stacomir/R/fungraph_civelle.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/fungraph_civelle.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -20,7 +20,7 @@
# pour adapter aux bilanMigrationMult, ligne par defaut...
#cat("fungraph_civelle")
if (is.null(dc)) dc=bilanMigration at dc@dc_selectionne[1]
- annee=unique(strftime(as.POSIXlt(time.sequence),"%Y"))
+ annee=paste(unique(strftime(as.POSIXlt(time.sequence),"%Y")),collapse=",")
mois= months(time.sequence)
jour= strftime(as.POSIXlt(time.sequence),"%j")
index=table$No.pas+1
Modified: pkg/stacomir/R/funstat.r
===================================================================
--- pkg/stacomir/R/funstat.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/funstat.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -14,7 +14,7 @@
if (!silent) funout(get("msg",envir=envir_stacomi)$funstat.1)
mois=strftime(as.POSIXlt(time.sequence),"%m")
moislab=unique(mois)
- annee=unique(strftime(as.POSIXlt(time.sequence),"%Y"))
+ annee=paste(unique(strftime(as.POSIXlt(time.sequence),"%Y")),collapse=",")
somme=tapply(tableau$Effectif_total, mois, sum, na.rm=TRUE) # sums
moyennes_journalieres=tapply(tableau$Effectif_total, mois, mean, na.rm=TRUE) # means
#ecarts_types=tapply(tableau$Effectif_total, mois, sd, na.rm=TRUE) # std. deviations
Modified: pkg/stacomir/R/funtable.r
===================================================================
--- pkg/stacomir/R/funtable.r 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/R/funtable.r 2016-09-28 11:32:30 UTC (rev 221)
@@ -11,7 +11,7 @@
#' @param silent If TRUE, all messages turned off (except warnings and errors)
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
funtable=function(tableau,time.sequence,taxon,stade,DC,resum,silent){
- annee=unique(strftime(as.POSIXlt(time.sequence),"%Y"))
+ annee=paste(unique(strftime(as.POSIXlt(time.sequence),"%Y")),collapse=",")
tableau$debut_pas<-as.character(tableau$debut_pas)
path1=file.path(path.expand(get("datawd",envir=envir_stacomi)),paste(DC,"_",taxon,"_",stade,"_",annee,".csv",sep=""),fsep ="/")
write.table(tableau,file=path1,row.names=FALSE,col.names=TRUE,sep=";")
Modified: pkg/stacomir/data/bMM_Arzal.rda
===================================================================
(Binary files differ)
Modified: pkg/stacomir/data/bM_Arzal.rda
===================================================================
(Binary files differ)
Modified: pkg/stacomir/data/bilanFonctionnementDC.rda
===================================================================
(Binary files differ)
Added: pkg/stacomir/data/bilanFonctionnementDC_bM.rda
===================================================================
(Binary files differ)
Property changes on: pkg/stacomir/data/bilanFonctionnementDC_bM.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: pkg/stacomir/data/bilanFonctionnementDF.rda
===================================================================
(Binary files differ)
Added: pkg/stacomir/data/bilanFonctionnementDF_bM.rda
===================================================================
(Binary files differ)
Property changes on: pkg/stacomir/data/bilanFonctionnementDF_bM.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: pkg/stacomir/data/bilanOperation.rda
===================================================================
(Binary files differ)
Added: pkg/stacomir/data/bilanOperation_bM.rda
===================================================================
(Binary files differ)
Property changes on: pkg/stacomir/data/bilanOperation_bM.rda
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: pkg/stacomir/inst/config/generate_data.R
===================================================================
--- pkg/stacomir/inst/config/generate_data.R 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/inst/config/generate_data.R 2016-09-28 11:32:30 UTC (rev 221)
@@ -41,22 +41,27 @@
##################################
require(stacomiR)
stacomi(FALSE,FALSE,FALSE)
-bM_Arzal=new("BilanMigrationMult")
-bM_Arzal=choice_c(bM_Arzal,
+bMM_Arzal=new("BilanMigrationMult")
+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)
+bMM_Arzal=choice_c(bMM_Arzal,
dc=c(5,6,12),
taxons=c("Anguilla anguilla"),
stades=c("AGG","AGJ","CIV"),datedebut="2011-01-01",datefin="2011-12-31")
-bM_Arzal<-charge(bM_Arzal)
-bM_Arzal<-connect(bM_Arzal,silent=FALSE)
+bMM_Arzal<-charge(bMM_Arzal)
+bMM_Arzal<-connect(bMM_Arzal,silent=FALSE)
# to avoid warnings at package checks
-bM_Arzal at dc@data[,"dis_commentaires"]<-iconv(bM_Arzal at dc@data[,"dis_commentaires"],from="latin1",to="UTF8")
-bM_Arzal at dc@data[,"type_df"]<-iconv(bM_Arzal at dc@data[,"type_df"],from="latin1",to="UTF8")
-bM_Arzal at dc@data[,"type_dc"]<-iconv(bM_Arzal at dc@data[,"type_dc"],from="latin1",to="UTF8")
-bM_Arzal at dc@data[,"dif_localisation"]<-iconv(bM_Arzal at dc@data[,"dif_localisation"],from="latin1",to="UTF8")
-bM_Arzal at taxons@data[,"tax_nom_commun"]<-iconv(bM_Arzal at taxons@data[,"tax_nom_commun"],from="latin1",to="UTF8")
-bM_Arzal at stades@data[,"std_libelle"]<-iconv(bM_Arzal at stades@data[,"std_libelle"],from="latin1",to="UTF8")
+bMM_Arzal at dc@data[,"dis_commentaires"]<-iconv(bMM_Arzal at dc@data[,"dis_commentaires"],from="latin1",to="UTF8")
+bMM_Arzal at dc@data[,"type_df"]<-iconv(bMM_Arzal at dc@data[,"type_df"],from="latin1",to="UTF8")
+bMM_Arzal at dc@data[,"type_dc"]<-iconv(bMM_Arzal at dc@data[,"type_dc"],from="latin1",to="UTF8")
+bMM_Arzal at dc@data[,"dif_localisation"]<-iconv(bMM_Arzal at dc@data[,"dif_localisation"],from="latin1",to="UTF8")
+bMM_Arzal at taxons@data[,"tax_nom_commun"]<-iconv(bMM_Arzal at taxons@data[,"tax_nom_commun"],from="latin1",to="UTF8")
+bMM_Arzal at stades@data[,"std_libelle"]<-iconv(bMM_Arzal at stades@data[,"std_libelle"],from="latin1",to="UTF8")
setwd("F:/workspace/stacomir/pkg/stacomir")
-devtools::use_data(bM_Arzal,internal=FALSE,overwrite=TRUE)
+devtools::use_data(bMM_Arzal,internal=FALSE,overwrite=TRUE)
bilanOperation<-get("bilanOperation",envir=envir_stacomi)
devtools::use_data(bilanOperation,internal=FALSE,overwrite=TRUE)
bilanFonctionnementDF<-get("bilanFonctionnementDF",envir=envir_stacomi)
@@ -73,12 +78,18 @@
login_window=FALSE,
database_expected=FALSE)
bM_Arzal=new("BilanMigration")
+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)
bM_Arzal=choice_c(bM_Arzal,
dc=5,
taxons=c("Liza ramada"),
stades=c("IND"),
datedebut="2015-01-01",
datefin="2015-12-31")
+bM_Arzal<-charge(bM_Arzal)
bM_Arzal<-connect(bM_Arzal)
bM_Arzal at dc@data[,"dis_commentaires"]<-iconv(bM_Arzal at dc@data[,"dis_commentaires"],from="latin1",to="UTF8")
bM_Arzal at dc@data[,"type_df"]<-iconv(bM_Arzal at dc@data[,"type_df"],from="latin1",to="UTF8")
@@ -88,9 +99,14 @@
bM_Arzal at stades@data[,"std_libelle"]<-iconv(bM_Arzal at stades@data[,"std_libelle"],from="latin1",to="UTF8")
setwd("F:/workspace/stacomir/pkg/stacomir")
devtools::use_data(bM_Arzal,internal=FALSE,overwrite=TRUE)
+bilanOperation_bM<-get("bilanOperation",envir=envir_stacomi)
+devtools::use_data(bilanOperation_bM,internal=FALSE,overwrite=TRUE)
+bilanFonctionnementDF_bM<-get("bilanFonctionnementDF",envir=envir_stacomi)
+devtools::use_data(bilanFonctionnementDF_bM,internal=FALSE,overwrite=TRUE)
+bilanFonctionnementDC_bM<-get("bilanFonctionnementDC",envir=envir_stacomi)
+devtools::use_data(bilanFonctionnementDC_bM,internal=FALSE,overwrite=TRUE)
-
#################################
# generates dataset for BilanFonctionnementDF
##################################
Modified: pkg/stacomir/inst/config/testthat.R
===================================================================
--- pkg/stacomir/inst/config/testthat.R 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/inst/config/testthat.R 2016-09-28 11:32:30 UTC (rev 221)
@@ -14,3 +14,4 @@
test_file("F:/workspace/stacomir/pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R")
+test_file("F:/workspace/stacomir/pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R")
\ No newline at end of file
Modified: pkg/stacomir/inst/examples/bilanMigration_Arzal.R
===================================================================
--- pkg/stacomir/inst/examples/bilanMigration_Arzal.R 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/inst/examples/bilanMigration_Arzal.R 2016-09-28 11:32:30 UTC (rev 221)
@@ -17,6 +17,7 @@
datedebut="2015-01-01",
datefin="2015-12-31")
bM_Arzal<-connect(bM_Arzal)
+ bM_Arzal<-charge(bM_Arzal)
}
@@ -24,8 +25,14 @@
# use the following to get the raw data loaded by the connect method
# not shown there as the database and program might not be installed
-#bM_Arzal<-connect(bM_Arzal)
-#str(bM_Arzal at data)
+# All three classes were created by the charge and connect method of BilanMigrationMult
+# in the previous example
+data("bilanOperation_bM")
+assign("bilanOperation",bilanOperation_bM,envir=envir_stacomi)
+data("bilanFonctionnementDF_bM")
+assign("bilanFonctionnementDF",bilanFonctionnementDF_bM,envir=envir_stacomi)
+data("bilanFonctionnementDC_bM")
+assign("bilanFonctionnementDC",bilanFonctionnementDC_bM,envir=envir_stacomi)
# calculations
bM_Arzal<-calcule(bM_Arzal,silent=TRUE)
#Individual plot for all DC (standard), taxon and stage where data present
Modified: pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R
===================================================================
--- pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/inst/tests/testthat/test-01BilanMigrationMult.R 2016-09-28 11:32:30 UTC (rev 221)
@@ -97,7 +97,7 @@
# check if built with examples (Rtools install --example
example_path<-file.path(.libPaths(),"stacomiR","R-ex","BilanMigrationMult-class.R")
test<-file.access(example_path,0)
- if (test!=0) warnings("Package example dir not created ?") else
+ if (test[1]!=0) warnings("Package example dir not created ?") else
source(example_path)
})
Modified: pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R
===================================================================
--- pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/inst/tests/testthat/test-02BilanMigration.R 2016-09-28 11:32:30 UTC (rev 221)
@@ -41,7 +41,9 @@
stades=c("IND"),
datedebut="2015-01-01",
datefin="2015-12-31")
- bM_Arzal<-connect(bM_Arzal)
+ bM_Arzal<-charge(bM_Arzal,silent=TRUE)
+ bM_Arzal<-connect(bM_Arzal,silent=TRUE)
+
expect_length(bM_Arzal at data,11)
rm("envir_stacomi",envir =.GlobalEnv)
})
@@ -53,7 +55,7 @@
# be sure you have built Roxygen documentation before running
example_path<-file.path(.libPaths(),"stacomiR","R-ex","BilanMigration-class.R")
test<-file.access(example_path,0)
- if (test!=0) warnings("Package example dir not created ?") else
+ if (test[1]!=0) warnings("Package example dir not created ?") else
source(example_path)
})
Modified: pkg/stacomir/man/BilanMigration-class.Rd
===================================================================
--- pkg/stacomir/man/BilanMigration-class.Rd 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/man/BilanMigration-class.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -52,6 +52,7 @@
datedebut="2015-01-01",
datefin="2015-12-31")
bM_Arzal<-connect(bM_Arzal)
+ bM_Arzal<-charge(bM_Arzal)
}
@@ -59,8 +60,14 @@
# use the following to get the raw data loaded by the connect method
# not shown there as the database and program might not be installed
-#bM_Arzal<-connect(bM_Arzal)
-#str(bM_Arzal at data)
+# All three classes were created by the charge and connect method of BilanMigrationMult
+# in the previous example
+data("bilanOperation_bM")
+assign("bilanOperation",bilanOperation_bM,envir=envir_stacomi)
+data("bilanFonctionnementDF_bM")
+assign("bilanFonctionnementDF",bilanFonctionnementDF_bM,envir=envir_stacomi)
+data("bilanFonctionnementDC_bM")
+assign("bilanFonctionnementDC",bilanFonctionnementDC_bM,envir=envir_stacomi)
# calculations
bM_Arzal<-calcule(bM_Arzal,silent=TRUE)
#Individual plot for all DC (standard), taxon and stage where data present
Added: pkg/stacomir/man/bilanFonctionnementDC.Rd
===================================================================
--- pkg/stacomir/man/bilanFonctionnementDC.Rd (rev 0)
+++ pkg/stacomir/man/bilanFonctionnementDC.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data.r
+\docType{data}
+\name{bilanFonctionnementDC}
+\alias{bilanFonctionnementDC}
+\title{An object of class \link{BilanFonctionnementDC-class} with data loaded}
+\format{An object of class BilanFonctionnementDC}
+\usage{
+bilanFonctionnementDC
+}
+\description{
+This dataset corresponds to the data collected at three different control devices
+it is loaded along with \link{bM_Arzal}
+}
+\keyword{data}
+
Added: pkg/stacomir/man/bilanFonctionnementDF.Rd
===================================================================
--- pkg/stacomir/man/bilanFonctionnementDF.Rd (rev 0)
+++ pkg/stacomir/man/bilanFonctionnementDF.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data.r
+\docType{data}
+\name{bilanFonctionnementDF}
+\alias{bilanFonctionnementDF}
+\title{An object of class \link{BilanFonctionnementDF-class} with data loaded}
+\format{An object of class BilanFonctionnementDF}
+\usage{
+bilanFonctionnementDF
+}
+\description{
+This dataset corresponds to the data collected at three different fishways
+it is loaded along with \link{bM_Arzal}
+}
+\keyword{data}
+
Added: pkg/stacomir/man/bilanOperation.Rd
===================================================================
--- pkg/stacomir/man/bilanOperation.Rd (rev 0)
+++ pkg/stacomir/man/bilanOperation.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -0,0 +1,16 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/data.r
+\docType{data}
+\name{bilanOperation}
+\alias{bilanOperation}
+\title{An object of class \link{BilanOperation-class} with data loaded}
+\format{An object of class BilanOperation}
+\usage{
+bilanOperation
+}
+\description{
+This dataset corresponds to the data collected at three different control devices
+it is loaded along with \link{bM_Arzal}
+}
+\keyword{data}
+
Modified: pkg/stacomir/man/charge-BilanMigration-method.Rd
===================================================================
--- pkg/stacomir/man/charge-BilanMigration-method.Rd 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/man/charge-BilanMigration-method.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -16,7 +16,8 @@
An object of class \link{BilanMigration-class} with slots filled by user choice
}
\description{
-fills also the data slot by the connect method
+this method creates additional classes in envir_stacomi for later use in plot (operations,
+DF operation, DC operation.
}
\author{
Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
Modified: pkg/stacomir/man/connect-BilanMigration-method.Rd
===================================================================
--- pkg/stacomir/man/connect-BilanMigration-method.Rd 2016-09-25 19:42:34 UTC (rev 220)
+++ pkg/stacomir/man/connect-BilanMigration-method.Rd 2016-09-28 11:32:30 UTC (rev 221)
@@ -5,10 +5,12 @@
\alias{connect,BilanMigration-method}
\title{connect method for BilanMigration}
\usage{
-\S4method{connect}{BilanMigration}(object)
+\S4method{connect}{BilanMigration}(object, silent = FALSE)
}
\arguments{
\item{object}{An object of class \link{BilanMigration-class}}
+
+\item{silent}{Boolean default FALSE, if TRUE information messages not displayed}
}
\value{
BilanMigration with slot @data filled from the database
More information about the Stacomir-commits
mailing list