r - Convert a string of integers from input to array of integers -
i have string of integers input text box (in shiny) this:
input[["var1"]] "1,2,3,4"
i want convert numeric vector like:
values <- c(1,2,3,4)
any highly appreciated.
thanks, yes did make attempt earlier, , solved now. please find answer below.
a <- "1,2,3,4" [1] "1,2,3,4" input_values <- as.numeric(unlist(strsplit(a,","))) input_values [1] 1 2 3 4
thanks @ananda,
regards, ravijeet
Comments
Post a Comment