aboutsummaryrefslogtreecommitdiff
path: root/R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2015-10-23 07:05:48 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2015-10-23 07:06:33 +0200
commit78b66d0fab2557cd4e0a13244eb371e6d521c9d3 (patch)
tree37d508dd797d6c27ad63541bb2fe9d7c9068faee /R
parentc737c606058cb4c2a0805e2bec8ce356d01a627a (diff)
Remove the current selections from the gmkin workspace
Diffstat (limited to 'R')
-rw-r--r--R/gmkinws.R15
1 files changed, 2 insertions, 13 deletions
diff --git a/R/gmkinws.R b/R/gmkinws.R
index c6f1ec5..dcc15d5 100644
--- a/R/gmkinws.R
+++ b/R/gmkinws.R
@@ -26,22 +26,16 @@
#' @field observed Names of the observed variables in the datasets, named
#' by the names used in the models contained in field m
#' @field ds A list of datasets compatible with mkinfit (long format)
-#' @field ds.cur Index of the currently selected dataset
#' @field m A list of mkinmod models
-#' @field m.cur Index of the currently selected model
#' @field f A list of mkinfit objects
-#' @field f.cur Index of the currently selected fit
#' @field s The summaries of the mkinfit objects in field f
gmkinws <- R6Class("gmkinws",
public = list(
observed = NULL,
ds = list(),
- ds.cur = NULL,
m = list(),
- m.cur = NULL,
f = list(),
- f.cur = NULL,
s = NA,
initialize = function(ds, m, f, ds.cur = NA, m.cur = NA, f.cur = NA) {
@@ -50,7 +44,6 @@ gmkinws <- R6Class("gmkinws",
if (!missing(ds)) {
self$check_ds(ds)
self$ds = ds
- self$ds.cur = ds.cur
# Collect names of observed variables
self$observed <- unique(sapply(ds, function(x) x$observed))
@@ -61,13 +54,11 @@ gmkinws <- R6Class("gmkinws",
self$check_m(m)
self$m <- m
}
- self$m.cur = m.cur
## Fits
if (!missing(f)) {
self$f <- f
}
- self$f.cur = f.cur
invisible(self)
},
@@ -86,7 +77,7 @@ gmkinws <- R6Class("gmkinws",
self$check_ds(ds)
common_names = intersect(names(self$ds), names(ds))
if (length(common_names) > 0) stop("Dataset name(s) ", paste(common_names, collapse = ", "), " already used.")
- else append(self$ds, ds)
+ else self$ds <- append(self$ds, ds)
# Update names of observed variables
observed <- unique(sapply(ds, function(x) x$observed))
@@ -122,8 +113,6 @@ print.gmkinws <- function(x, ...) {
print(x$ds)
cat("\nModels:\n")
print(x$m)
- cat("Current selections:\n")
- cat("Dataset ", x$ds.cur, ", Model ", x$m.cur, ", Fit ", x$f.cur, "\n", sep = "")
- cat("\nFits:\n")
+ cat("\nNames of fits:\n")
print(names(x$f))
}

Contact - Imprint