[Stacomir-commits] r295 - in pkg/stacomir: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Feb 27 16:12:32 CET 2017
Author: briand
Date: 2017-02-27 16:12:31 +0100 (Mon, 27 Feb 2017)
New Revision: 295
Modified:
pkg/stacomir/R/BilanMigration.r
pkg/stacomir/R/BilanMigrationMult.r
pkg/stacomir/man/BilanMigration-class.Rd
pkg/stacomir/man/BilanMigrationMult-class.Rd
Log:
bug when writing to the database after having checked that data have changed (BilanMigrationInterannuelle)
Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r 2017-02-12 20:44:58 UTC (rev 294)
+++ pkg/stacomir/R/BilanMigration.r 2017-02-27 15:12:31 UTC (rev 295)
@@ -18,6 +18,7 @@
#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
#' @family Bilan Objects
#' @keywords classes
+#' @aliases BilanMigration bilanMigration
#' @example inst/examples/bilanMigration_Arzal.R
#' @export
setClass(Class="BilanMigration",
@@ -580,6 +581,7 @@
#' @export
setMethod("write_database",signature=signature("BilanMigration"),definition=function(object,silent=TRUE,dbname="bd_contmig_nat",host="localhost",port=5432,check_for_bjo=TRUE){
# dbname="bd_contmig_nat";host="localhost";silent=FALSE;port=5432
+ # object=bM
bilanMigration<-object
if (class(bilanMigration)!="BilanMigration") stop("the bilanMigration should be of class BilanMigration")
if (class(silent)!="logical") stop("the silent argument should be a logical")
@@ -590,7 +592,11 @@
col_a_retirer=match(c("No.pas","type_de_quantite","debut_pas","fin_pas"),colnames(data))
data=data[,-col_a_retirer]
data$taux_d_echappement[data$taux_d_echappement==-1]<-NA
+ # bug 27/02/2017 for some reasons crashes with arzal and coef_valeur_coefficient
+ # and didn't crash for logrami or smatah
+ if (!is.null(data$coe_valeur_coefficient)){
data$coe_valeur_coefficient[data$"coe_valeur_coefficient"==1]<-NA
+ }else {data$coe_valeur_coefficient<-NA}
peuventpaszero=match(c("taux_d_echappement","coe_valeur_coefficient"),colnames(data))
data[,-peuventpaszero][data[,-peuventpaszero]==0]<-NA
annee<-as.numeric(unique(strftime(as.POSIXlt(bilanMigration at time.sequence),"%Y"))[1])
Modified: pkg/stacomir/R/BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/BilanMigrationMult.r 2017-02-12 20:44:58 UTC (rev 294)
+++ pkg/stacomir/R/BilanMigrationMult.r 2017-02-27 15:12:31 UTC (rev 295)
@@ -25,6 +25,7 @@
#' method if any weight are found in the data slot.
#' @slot time.sequence A POSIXt time sequence
#' @family Bilan Objects
+#' @aliases BilanMigrationMult bilanMigrationMult
#' @keywords classes
#' @export
#' @example inst/examples/bilanMigrationMult_Arzal.R
Modified: pkg/stacomir/man/BilanMigration-class.Rd
===================================================================
--- pkg/stacomir/man/BilanMigration-class.Rd 2017-02-12 20:44:58 UTC (rev 294)
+++ pkg/stacomir/man/BilanMigration-class.Rd 2017-02-27 15:12:31 UTC (rev 295)
@@ -2,7 +2,9 @@
% Please edit documentation in R/BilanMigration.r
\docType{class}
\name{BilanMigration-class}
+\alias{BilanMigration}
\alias{BilanMigration-class}
+\alias{bilanMigration}
\title{Migration report for one DC, one species and one stage}
\description{
Migration report for one DC, one species and one stage
Modified: pkg/stacomir/man/BilanMigrationMult-class.Rd
===================================================================
--- pkg/stacomir/man/BilanMigrationMult-class.Rd 2017-02-12 20:44:58 UTC (rev 294)
+++ pkg/stacomir/man/BilanMigrationMult-class.Rd 2017-02-27 15:12:31 UTC (rev 295)
@@ -2,7 +2,9 @@
% Please edit documentation in R/BilanMigrationMult.r
\docType{class}
\name{BilanMigrationMult-class}
+\alias{BilanMigrationMult}
\alias{BilanMigrationMult-class}
+\alias{bilanMigrationMult}
\title{Migration reports for multiple DC / species / stages}
\description{
Migration counts for several Fish counting devices (DC), several taxa and several stages.
More information about the Stacomir-commits
mailing list