{
  "name": "strsplit() edge cases: documented results for common split patterns",
  "description": "Compiled from the R reference manual for strsplit {base}: the documented result of splitting specific example strings, covering regular-expression versus fixed matching, leading and trailing separators, and empty or single-space inputs.",
  "page": "https://casrai.org/guides/strsplit-in-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T22:02:08Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Call",
      "unit": "",
      "description": ""
    },
    {
      "name": "Input string",
      "unit": "",
      "description": ""
    },
    {
      "name": "Result",
      "unit": "",
      "description": ""
    },
    {
      "name": "Rule that explains it",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Call": "strsplit(x, \".\")",
      "Input string": "a.b.c",
      "Result": "five empty strings (\"\")",
      "Rule that explains it": "split is a regular expression and \".\" matches every character"
    },
    {
      "Call": "strsplit(x, \"[.]\")",
      "Input string": "a.b.c",
      "Result": "\"a\" \"b\" \"c\"",
      "Rule that explains it": "bracketed dot matches a literal dot"
    },
    {
      "Call": "strsplit(x, \".\", fixed = TRUE)",
      "Input string": "a.b.c",
      "Result": "\"a\" \"b\" \"c\"",
      "Rule that explains it": "fixed = TRUE matches split exactly"
    },
    {
      "Call": "strsplit(x, \"#\")",
      "Input string": "#a#",
      "Result": "\"\" \"a\"",
      "Rule that explains it": "match at start gives empty first element; match at end adds nothing"
    },
    {
      "Call": "strsplit(x, \" \")",
      "Input string": "(empty string)",
      "Result": "character(0)",
      "Rule that explains it": "an empty input string yields no pieces"
    },
    {
      "Call": "strsplit(x, \" \")",
      "Input string": "(one space)",
      "Result": "\"\"",
      "Rule that explains it": "the single match leaves an empty piece to its left"
    }
  ],
  "sources": [
    {
      "title": "R reference manual: strsplit {base}",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/strsplit.html",
      "accessed": "2026-11-15"
    }
  ]
}