diff --git a/R/and.R b/R/and.R index 13e8e98..3614a52 100644 --- a/R/and.R +++ b/R/and.R @@ -134,7 +134,7 @@ and <- function(input, output, session, data, show.elements = NULL, element.grou # keep grouping order grouping <- grouping[unique(element.grouping[[2]])] - return <- lapply(1:length(grouping), function(i){ + return <- lapply(seq_len(length(grouping)), function(i){ group <- lapply(unlist(grouping[i]), function(x){ progress$inc(step, detail = x) @@ -164,7 +164,7 @@ and <- function(input, output, session, data, show.elements = NULL, element.grou shiny::tagList(shinydashboard::box(width = 12, collapsible = TRUE, collapsed = TRUE, title = names(grouping[i]), shiny::tagList(group))) }) } else { - return <- lapply(1:ncol(data), function(x) { + return <- lapply(seq_len(ncol(data)), function(x) { progress$inc(step, detail = names(data)[x]) if (is.numeric(data[[x]])) { ui <- orNumericUI(id = session$ns(openssl::sha1(names(data)[x]))) @@ -205,7 +205,7 @@ and <- function(input, output, session, data, show.elements = NULL, element.grou progress$set(0, message = "Filtering Module:") step <- ncol(data_r()) - lapply(1:ncol(data_r()), function(x) { + lapply(seq_len(ncol(data_r())), function(x) { progress$inc(step, detail = names(data_r())[x]) if (is.numeric(data_r()[[x]])) { if (parameter()$ranged[x]) { diff --git a/R/featureSelector.R b/R/featureSelector.R index 0e2be02..2d9f4ba 100644 --- a/R/featureSelector.R +++ b/R/featureSelector.R @@ -99,7 +99,7 @@ featureSelector <- function(input, output, session, clarion, multiple = TRUE, co # row_selector choices choices <- shiny::reactive({ if (nrow(data_output()$data) > 0) { - c(1:nrow(data_output()$data)) + seq_len(nrow(data_output()$data)) } else { c(0, 0) } diff --git a/R/function.R b/R/function.R index 8152510..5506fef 100644 --- a/R/function.R +++ b/R/function.R @@ -798,7 +798,7 @@ create_geneview <- function(data, grouping, plot.type = "line", facet.target = " # place former colnames in cols data$cols <- data_cols - data.table::setcolorder(data, c("cols", colnames(data)[1:ncol(data) - 1])) + data.table::setcolorder(data, c("cols", colnames(data)[seq_len(ncol(data)) - 1])) # reattach ids as colnames names(data)[2:ncol(data)] <- data_id