aboutsummaryrefslogtreecommitdiff
path: root/inst/GUI
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2014-05-11 18:53:55 +0200
committerJohannes Ranke <jranke@uni-bremen.de>2014-05-12 06:20:30 +0200
commit3a8db4b71d77f05c4d1e753558f5ecc505bf69af (patch)
treeef0c24efb41d24a41f83faa9f7c2227f3595946e /inst/GUI
parent325bc51393b8ce4e6782eb03692b5534f13658d7 (diff)
Improvement of dataset uploading. Fixes #1
Diffstat (limited to 'inst/GUI')
-rw-r--r--inst/GUI/gmkin.R13
1 files changed, 7 insertions, 6 deletions
diff --git a/inst/GUI/gmkin.R b/inst/GUI/gmkin.R
index 46bd405..a2fb132 100644
--- a/inst/GUI/gmkin.R
+++ b/inst/GUI/gmkin.R
@@ -354,11 +354,12 @@ new_ds_from_csv_handler <- function(h, ...) {
if(svalue(ds.e.up.widelong) == "wide") {
tmpdl <- mkin_wide_to_long(tmpd, time = as.character(svalue(ds.e.up.wide.time)))
} else {
- tmpdl <- data.frame()
- tmpdl$name <- tmpd[[svalue(ds.e.up.long.name)]]
- tmpdl$time <- tmpd[[svalue(ds.e.up.long.time)]]
- tmpdl$value <- tmpd[[svalue(ds.e.up.long.value)]]
- tmpdl$err <- tmpd[[svalue(ds.e.up.long.err)]]
+ tmpdl <- data.frame(
+ name = tmpd[[svalue(ds.e.up.long.name)]],
+ time = tmpd[[svalue(ds.e.up.long.time)]],
+ value = tmpd[[svalue(ds.e.up.long.value)]])
+ tmpderr <- tmpd[[svalue(ds.e.up.long.err)]]
+ if (!is.null(tmpderr)) tmpdl$err <- tmpderr
}
if (class(tmpd) != "try-error") {
ds.cur <<- as.character(1 + length(ds))
@@ -375,7 +376,7 @@ new_ds_from_csv_handler <- function(h, ...) {
length)$x),
data = tmpdl)
ds[[ds.cur]]$data$override <<- as.numeric(NA)
- ds[[ds.cur]]$data$err <<- 1
+ if (!is.null(ds[[ds.cur]]$data$err)) ds[[ds.cur]]$data$err <<- 1
update_ds.df()
ds.gtable[,] <- ds.df
update_ds_editor()

Contact - Imprint