x <- "[3, 4, 5, 6]"
x <- gsub("\\[|\\]","", x)
y <- as.numeric(unlist(strsplit(x, ",", fixed=TRUE)))
y
#> [1] 3 4 5 6
x <- "[3, 4, 5, 6]"
x <- gsub("\\[|\\]","", x)
y <- as.numeric(unlist(strsplit(x, ",", fixed=TRUE)))
y
#> [1] 3 4 5 6