{
  "name": "R environment cleanup operations and verification",
  "description": "Original cross-reference compiled from R Core documentation for object listing, removal, environment access, garbage collection and startup. It separates each operation’s target, documented effect and scope of verification; these are function semantics, not measured performance results.",
  "page": "https://casrai.org/guides/clear-environment-in-r",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-14T12:41:28Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Operation",
      "unit": "",
      "description": ""
    },
    {
      "name": "Target",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented effect",
      "unit": "",
      "description": ""
    },
    {
      "name": "Verification or limit",
      "unit": "",
      "description": ""
    },
    {
      "name": "Primary source URLs",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Operation": "ls(envir = .GlobalEnv, all.names = TRUE)",
      "Target": "Global frame",
      "Documented effect": "Lists object names, including names starting with a dot",
      "Verification or limit": "Inspection only; does not remove objects",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/ls.html"
    },
    {
      "Operation": "rm(list = c('samples', 'temporary_fit'), envir = .GlobalEnv)",
      "Target": "Named objects in global frame",
      "Documented effect": "Removes only the supplied names from the selected environment",
      "Verification or limit": "Preview that frame with ls; inherits defaults to FALSE",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/rm.html"
    },
    {
      "Operation": "rm(list = ls(envir = .GlobalEnv, all.names = TRUE), envir = .GlobalEnv)",
      "Target": "Names listed in global frame",
      "Documented effect": "Removes the listed bindings, including dot-prefixed names",
      "Verification or limit": "Repeat the same ls call; this checks the selected frame only",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/rm.html ; https://stat.ethz.ch/R-manual/R-devel/library/base/html/ls.html"
    },
    {
      "Operation": "rm(list = ls(envir = analysis, all.names = TRUE), envir = analysis)",
      "Target": "A separate environment named analysis",
      "Documented effect": "Removes names inside that environment",
      "Verification or limit": "The referring global name analysis remains",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/rm.html ; https://stat.ethz.ch/R-manual/R-devel/library/base/html/environment.html"
    },
    {
      "Operation": "gc()",
      "Target": "R memory management",
      "Documented effect": "Performs garbage collection and reports memory usage",
      "Verification or limit": "Automatic collection also occurs; no fixed memory-return guarantee",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/gc.html"
    },
    {
      "Operation": "R --vanilla",
      "Target": "New command-line session",
      "Documented effect": "Disables workspace restore and specified startup files",
      "Verification or limit": "Startup behavior differs from the usual session initialization",
      "Primary source URLs": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html"
    }
  ],
  "sources": [
    {
      "title": "R Core: List Objects",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/ls.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R Core: Remove Objects from a Specified Environment",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/rm.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R Core: Environment Access",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/environment.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R Core: Garbage Collection",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/gc.html",
      "accessed": "2026-11-14"
    },
    {
      "title": "R Core: Initialization at Start of an R Session",
      "url": "https://stat.ethz.ch/R-manual/R-devel/library/base/html/Startup.html",
      "accessed": "2026-11-14"
    }
  ]
}