diff --git a/NEWS.md b/NEWS.md index ab209026..f9527d79 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ - `figure2rmd()` - `table2rmd()` - `gdocs2rmd()` + - Fix `plot_raw()`: "length(x) = 2 > 1' in coercion to 'logical(1)" # inti 0.5.6 diff --git a/R/plot_raw.R b/R/plot_raw.R index a77506e8..e2ea94ea 100644 --- a/R/plot_raw.R +++ b/R/plot_raw.R @@ -53,9 +53,10 @@ #' #' fb %>% #' plot_raw(type = "sca" -#' , x = "hi" +#' , x = "geno" #' , y = "twue" -#' , group = "" +#' , group = "treat" +#' , color = c("red", "blue") #' ) #' #' } @@ -127,8 +128,8 @@ if(!c(y %in% colnames(data))) stop("colum no exist") opt <- if(is.null(opt) || is.na(opt) || opt == "") {NULL} else {opt} - color <- if(is.null(color) || is.na(color) || color == "" || color == "yes") { - TRUE} else if (color == "no") {FALSE} else {color} + color <- if(length(color) <= 1 && (is.null(color) || is.na(color) || color == "" || color == "yes")) { + TRUE} else {color} ylimits <- if(any(is.null(ylimits)) || any(is.na(ylimits)) || any(ylimits == "")) { NULL @@ -139,7 +140,7 @@ if(!c(y %in% colnames(data))) stop("colum no exist") unlist() %>% as.numeric() } else {ylimits} - xtext <- if(is.null(xtext) || is.na(xtext) || xtext == "") { + xtext <- if(length(xtext) <= 1 && (is.null(xtext) || is.na(xtext) || xtext == "")) { NULL} else if (is.character(xtext)){ xtext %>% strsplit(., ",") %>% @@ -147,7 +148,7 @@ if(!c(y %in% colnames(data))) stop("colum no exist") base::trimws() } else {xtext} - gtext <- if(is.null(gtext) || is.na(gtext) || gtext == "") { + gtext <- if (length(gtext) <= 1 && (is.null(gtext) || is.na(gtext) || gtext == "")) { NULL} else if (is.character(gtext)){ gtext %>% strsplit(., ",") %>% diff --git a/inst/yupana/rsconnect/shinyapps.io/flavjack/yupana.dcf b/inst/yupana/rsconnect/shinyapps.io/flavjack/yupana.dcf index 3ac17b4e..a2b14a62 100644 --- a/inst/yupana/rsconnect/shinyapps.io/flavjack/yupana.dcf +++ b/inst/yupana/rsconnect/shinyapps.io/flavjack/yupana.dcf @@ -5,9 +5,9 @@ account: flavjack server: shinyapps.io hostUrl: https://api.shinyapps.io/v1 appId: 357871 -bundleId: 5923320 +bundleId: 5931320 url: https://flavjack.shinyapps.io/yupana/ -when: 1652971133.1596 -lastSyncTime: 1652971133.15961 +when: 1653190943.78602 +lastSyncTime: 1653190943.78605 asMultiple: FALSE asStatic: FALSE diff --git a/man/plot_raw.Rd b/man/plot_raw.Rd index 0f3b2868..8cf7bc76 100644 --- a/man/plot_raw.Rd +++ b/man/plot_raw.Rd @@ -90,9 +90,10 @@ fb \%>\% fb \%>\% plot_raw(type = "sca" - , x = "hi" + , x = "geno" , y = "twue" - , group = "" + , group = "treat" + , color = c("red", "blue") ) }