aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--R/mkinds.R23
1 files changed, 13 insertions, 10 deletions
diff --git a/R/mkinds.R b/R/mkinds.R
index 60924c21..bed49be3 100644
--- a/R/mkinds.R
+++ b/R/mkinds.R
@@ -1,4 +1,4 @@
-# Copyright (C) 2015 Johannes Ranke
+# Copyright (C) 2015,2018 Johannes Ranke
# Contact: jranke@uni-bremen.de
# This file is part of the R package mkin
@@ -43,13 +43,16 @@ mkinds <- R6Class("mkinds",
initialize = function(title = "", data, time_unit = NA, unit = NA) {
- self$title = title
- self$sampling_times = sort(unique(data$time))
- self$time_unit = time_unit
- self$observed = unique(data$name)
- self$unit = unit
- self$replicates = max(by(data, list(data$name, data$time), nrow))
- self$data = data
+ self$title <- title
+ self$sampling_times <- sort(unique(data$time))
+ self$time_unit <- time_unit
+ self$observed <- unique(data$name)
+ self$unit <- unit
+ self$replicates <- max(by(data, list(data$name, data$time), nrow))
+ if (is.null(data$override)) data$override <- NA
+ if (is.null(data$err)) data$err <- 1
+ self$data <- data
+
}
)
)
@@ -60,6 +63,6 @@ print.mkinds <- function(x, ...) {
cat("Observed compounds $observed: ", paste(x$observed, collapse = ", "), "\n")
cat("Sampling times $sampling_times: ", paste(x$sampling_times, collapse = ", "), "\n")
cat("With a maximum of ", x$replicates, " replicates\n")
- if (!is.na(x$time_unit)) cat("Time units: ", x$time_units, "\n")
- if (!is.na(x$unit)) cat("Observation units: ", x$units, "\n")
+ if (!is.na(x$time_unit)) cat("Time unit: ", x$time_unit, "\n")
+ if (!is.na(x$unit)) cat("Observation unit: ", x$unit, "\n")
}

Contact - Imprint