Skip to content
Permalink
Browse files

drop list columns

  • Loading branch information...
pvictor committed Mar 4, 2019
1 parent 364576c commit eafd7c56aa8d14419638ddc952e2f64abc5aea2d
Showing with 13 additions and 4 deletions.
  1. +1 −1 DESCRIPTION
  2. +3 −0 R/esquisser.R
  3. +2 −2 R/esquisserServer.R
  4. +3 −0 R/get_data.R
  5. +4 −1 R/utils.R
@@ -1,7 +1,7 @@
Package: esquisse
Type: Package
Title: Explore and Visualize Your Data Interactively
Version: 0.1.7.940
Version: 0.1.7.950
Authors@R: c(person("Fanny", "Meyer", email = "fanny.meyer@dreamrs.fr", role = c("aut")),
person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")),
person("Ian", "Carroll", comment = "Facets support", role = "ctb"))
@@ -35,6 +35,9 @@ esquisser <- function(data = NULL,
options("esquisse.coerceVars" = coerceVars)

res_data <- get_data(data, name = deparse(substitute(data)))
if (!is.null(res_data$esquisse_data)) {
res_data$esquisse_data <- dropListColumns(res_data$esquisse_data)
}
rv <- reactiveValues(
data = res_data$esquisse_data,
name = res_data$esquisse_data_name
@@ -124,7 +124,7 @@ esquisserServer <- function(input, output, session, data = NULL, dataModule = c(
# print(paste("EXECUTED", i))

data <- dataChart$data
if (!is.null(paramsChart$index) && is.logical(paramsChart$index)) {
if (!is.null(paramsChart$index) && is.logical(paramsChart$index) & length(paramsChart$index) > 0) {
data <- data[paramsChart$index, , drop = FALSE]
}

@@ -209,7 +209,7 @@ esquisserServer <- function(input, output, session, data = NULL, dataModule = c(
}, ignoreInit = TRUE)
observeEvent(list(dataChart$data, paramsChart$index), {
data <- dataChart$data
if (!is.null(paramsChart$index) && is.logical(paramsChart$index)) {
if (!is.null(paramsChart$index) && is.logical(paramsChart$index) & length(paramsChart$index) > 0) {
data <- data[paramsChart$index, , drop = FALSE]
}
output_module$data <- data
@@ -42,6 +42,9 @@ get_data <- function(data = NULL, name = NULL) {
}

# esquisse_data_name <- gsub("\\[.*", "", esquisse_data_name)
} else {
esquisse_data <- NULL
esquisse_data_name <- ""
}
} else {
if (rstudioapi::isAvailable()) {
@@ -281,5 +281,8 @@ capitalize <- function(x) {
}



dropListColumns <- function(x) {
type_col <- vapply(X = x, FUN = typeof, FUN.VALUE = character(1), USE.NAMES = FALSE)
x[, type_col != "list", drop = FALSE]
}

0 comments on commit eafd7c5

Please sign in to comment.
You can’t perform that action at this time.