Skip to content

Commit

Permalink
and, featureSelector, function: use less error prone seq_len() instea…
Browse files Browse the repository at this point in the history
…d of 1:x
  • Loading branch information
HendrikSchultheis committed Jun 28, 2018
1 parent 8d41dfd commit 63f5ed9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions R/and.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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])))
Expand Down Expand Up @@ -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]) {
Expand Down
2 changes: 1 addition & 1 deletion R/featureSelector.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion R/function.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 63f5ed9

Please sign in to comment.