I have the following object.
object1 <- "c(3:6, 8, 10:13, 16, 21)"
I'd like to convert object1
, which is a character string, into the following numeric vector.
object2 <- c(3:6, 8, 10:13, 16, 21)
Are there any good solutions? base
R solutions are preferred but I'm open to anything. Thanks!