{
  "name": "R numeric conversion situations and audit checks",
  "description": "Original compilation across R Core Team manuals, contrasting explicit conversion, factor encoding, missing-value detection and import-time parsing. These are documented behaviours and editorial audit checks, not observed research measurements.",
  "page": "https://casrai.org/guides/as-numeric-in-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-15T11:21:04Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Input situation",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented behaviour",
      "unit": "",
      "description": ""
    },
    {
      "name": "Audit check",
      "unit": "",
      "description": ""
    },
    {
      "name": "Primary documentation",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Input situation": "Plain numeric text",
      "Documented behaviour": "as.numeric converts text to a numeric vector.",
      "Audit check": "Retain the raw input alongside converted values.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/numeric.html"
    },
    {
      "Input situation": "Unrecognised text token",
      "Documented behaviour": "Nonnumeric strings produce NA with a warning.",
      "Audit check": "Compare source and output missingness; investigate the token.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/numeric.html"
    },
    {
      "Input situation": "Factor with numeric labels",
      "Documented behaviour": "Direct conversion returns underlying level codes.",
      "Audit check": "Inspect labels; use character conversion first if labels are quantities.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/factor.html"
    },
    {
      "Input situation": "Already missing input",
      "Documented behaviour": "NA can be coerced to numeric; is.na detects missing entries.",
      "Audit check": "Separate pre-existing missingness from newly missing results.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/NA.html"
    },
    {
      "Input situation": "Named ordinary vector",
      "Documented behaviour": "Double conversion strips attributes, including names.",
      "Audit check": "Keep row identifiers separately from vector names.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/double.html"
    },
    {
      "Input situation": "Mixed numeric and other text",
      "Documented behaviour": "type.convert selects the first type accepting all nonmissing values.",
      "Audit check": "Set as.is explicitly; inspect whether text was retained.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/utils/html/type.convert.html"
    },
    {
      "Input situation": "Semicolon file with decimal commas",
      "Documented behaviour": "read.csv2 defaults to a semicolon separator and decimal comma.",
      "Audit check": "Configure the importer to match the file convention.",
      "Primary documentation": "https://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html"
    }
  ],
  "sources": [
    {
      "title": "R Core Team: Numeric Vectors",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/numeric.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "R Core Team: Double-Precision Vectors",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/double.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "R Core Team: Factors",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/factor.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "R Core Team: Not Available / Missing Values",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/NA.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "R Core Team: Convert Data to Appropriate Type",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/utils/html/type.convert.html",
      "accessed": "2026-11-15"
    },
    {
      "title": "R Core Team: Data Input",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/utils/html/read.table.html",
      "accessed": "2026-11-15"
    }
  ]
}