Skip to content

Note that this notebook was automatically generated from an RDocumentation page. It depends on the package and the example code whether this code will run without errors. You may need to edit the code to make things work.

if(!require('stringr')) {
    install.packages('stringr')
    library('stringr')
}
fruits <- c(
  "apples and oranges and pears and bananas",
  "pineapples and mangos and guavas"
)
str_split_fixed(fruits, "and ", 3)
str_split_fixed(fruits, "and ", 4)