Wrapper for strsplit()
that unlists and unnames results
Examples
# unnamed vector
splitter("XYZ")
#> [1] "X" "Y" "Z"
# named vector
splitter(c(x = "XYZ"))
#> [1] "X" "Y" "Z"
# unnamed list with one element
splitter(list("XYZ"))
#> [1] "X" "Y" "Z"
# unnamed list with multiple elements
splitter(list("YYY", "ZZZ"))
#> [[1]]
#> [1] "Y" "Y" "Y"
#>
#> [[2]]
#> [1] "Z" "Z" "Z"
#>
# named list with one element
splitter(list(x = "XYZ"))
#> [1] "X" "Y" "Z"
# named list with multiple elements
splitter(list(x = "YYY", xx = "ZZZ"))
#> [[1]]
#> [1] "Y" "Y" "Y"
#>
#> [[2]]
#> [1] "Z" "Z" "Z"
#>