{"id":15893029,"url":"https://github.com/nanxstats/r-windows-paths","last_synced_at":"2025-03-20T12:33:57.614Z","repository":{"id":255476510,"uuid":"851987172","full_name":"nanxstats/r-windows-paths","owner":"nanxstats","description":"R command-line tool paths on Windows systems","archived":false,"fork":false,"pushed_at":"2024-10-05T22:21:42.000Z","size":1057,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-07T08:06:09.464Z","etag":null,"topics":["command-line","pandoc","quarto","r","rtools","tinytex","windows"],"latest_commit_sha":null,"homepage":"https://nanx.me/blog/post/r-windows-paths/","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nanxstats.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T02:58:58.000Z","updated_at":"2024-10-05T22:21:45.000Z","dependencies_parsed_at":"2024-09-05T16:58:50.080Z","dependency_job_id":"d86ba498-8830-451c-a09f-dd92f46d8b13","html_url":"https://github.com/nanxstats/r-windows-paths","commit_stats":null,"previous_names":["nanxstats/r-windows-paths"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxstats%2Fr-windows-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxstats%2Fr-windows-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxstats%2Fr-windows-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nanxstats%2Fr-windows-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nanxstats","download_url":"https://codeload.github.com/nanxstats/r-windows-paths/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221766689,"owners_count":16877333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","pandoc","quarto","r","rtools","tinytex","windows"],"created_at":"2024-10-06T08:06:26.933Z","updated_at":"2024-10-28T02:20:24.302Z","avatar_url":"https://github.com/nanxstats.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n# To center the elements correctly on GitHub, we need to post-process\n# \u003cp\u003e\u003c/p\u003e blocks to remove blank lines after \u003cp\u003e and add two leading spaces\n# before each \u003ca\u003e tag.\nknit: |\n  (function(inputFile, encoding) {\n    rmarkdown::render(input = inputFile, encoding = encoding)\n    output \u003c- paste0(basename(tools::file_path_sans_ext(inputFile)), \".md\")\n    content \u003c- paste0(readLines(output), collapse = \"\\n\")\n\n    matches \u003c- gregexpr(\"(?s)\u003cp[^\u003e]*\u003e.*?\u003c/p\u003e\", content, perl = TRUE)\n    match_texts \u003c- regmatches(content, matches)[[1]]\n    process_p_block \u003c- function(block) {\n      block \u003c- gsub(\"(\u003cp[^\u003e]*\u003e)[ \\\\t]*\\\\n([ \\\\t]*\\\\n)*\", \"\\\\\\\\1\\n\", block)\n      block \u003c- gsub(\"(\u003ca[^\u003e]*\u003e)\", \"  \\\\\\\\1\", block)\n      block\n    }\n    modified_texts \u003c- vapply(match_texts, process_p_block, character(1))\n    regmatches(content, matches)[[1]] \u003c- modified_texts\n\n    writeLines(content, con = output)\n    invisible(output)\n  })\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include=FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  echo = FALSE\n)\n```\n\n# r-windows-paths\n\n\u003ca href=\"https://nanx.me/blog/post/r-windows-paths/\"\u003e\n\u003cimg src=\"images/banner.png\" alt=\"r-windows-paths\"\u003e\n\u003c/a\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#example-versions\"\u003e\u003cstrong\u003eExample versions\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#configure-and-verify\"\u003e\u003cstrong\u003eConfigure and verify\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#r\"\u003e\u003cstrong\u003eR\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#rtools\"\u003e\u003cstrong\u003eRtools\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#tinytex\"\u003e\u003cstrong\u003eTinyTeX\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#miktex\"\u003e\u003cstrong\u003eMiKTeX\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#pandoc\"\u003e\u003cstrong\u003ePandoc\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#quarto\"\u003e\u003cstrong\u003eQuarto\u003c/strong\u003e\u003c/a\u003e ·\n  \u003ca href=\"#git\"\u003e\u003cstrong\u003eGit\u003c/strong\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nEssential R command-line tool paths on Windows.\nThis information can help setting up the `PATH` environment variable\nfor seamless command-line access.\n\n## Example versions\n\nSome of the paths below are specific to the installed software version.\nWe use these software version examples:\n\n```{r}\nstr_extract_first \u003c- function(x, pattern) {\n  m \u003c- regexec(pattern, text = x, perl = TRUE)\n  regmatches(x, m = m)[[1]][2]\n}\n\nget_r_version \u003c- function() {\n  \"http://cran.r-project.org/src/base/VERSION-INFO.dcf\" |\u003e\n    url() |\u003e\n    read.dcf() |\u003e\n    as.data.frame() |\u003e\n    getElement(name = \"Release\")\n}\n\nget_rtools_version \u003c- function() {\n  version_string \u003c- \"https://raw.githubusercontent.com/r-windows/rtools-chocolatey/master/src/rtools.nuspec\" |\u003e\n    curl::curl_fetch_memory() |\u003e\n    getElement(name = \"content\") |\u003e\n    rawToChar() |\u003e\n    str_extract_first(pattern = \"\u003cversion\u003e(.*?)\u003c/version\u003e\")\n\n  parts \u003c- strsplit(version_string, \"\\\\.\")[[1]]\n  paste0(parts[1], parts[2])\n}\n\nget_rstudio_version \u003c- function() {\n  version_string \u003c- \"http://download1.rstudio.org/current.ver\" |\u003e\n    curl::curl_fetch_memory() |\u003e\n    getElement(name = \"content\") |\u003e\n    rawToChar()\n\n  parts \u003c- strsplit(trimws(version_string), \"\\\\+\")[[1]]\n  major \u003c- parts[1]\n  minor \u003c- strsplit(parts[2], \"\\\\.\")[[1]][1]\n  list(major = major, minor = minor)\n}\n\nr_version \u003c- get_r_version()\nrtools_version \u003c- get_rtools_version()\nrstudio_version \u003c- get_rstudio_version()\nrstudio_version_major \u003c- rstudio_version$major\nrstudio_version_minor \u003c- rstudio_version$minor\n```\n\n- R `r r_version`\n- Rtools`r rtools_version`\n- RStudio Desktop `r sprintf(\"%s+%s\", rstudio_version_major, rstudio_version_minor)`\n\n## Key paths\n\n### R\n\n`R.exe` and `Rscript.exe` for running `R CMD build` and `R CMD check`.\n\nR release version `r r_version`:\n\n```batchfile\nC:\\Program Files\\R\\R-`r r_version`\\bin\n```\n\nR-devel:\n\n```batchfile\nC:\\Program Files\\R\\R-devel\\bin\n```\n\n### Rtools\n\nC/C++/Fortran toolchain for building R and R packages from source.\n\nContains `gcc`, `g++`, `gfortran`:\n\n```batchfile\nC:\\rtools`r rtools_version`\\x86_64-w64-mingw32.static.posix\\bin\n```\n\nContains Texinfo (`texi2dvi`, `texi2pdf`) required by `R CMD check`,\nand GNU Make (`make`) required for building R from source:\n\n```batchfile\nC:\\rtools`r rtools_version`\\usr\\bin\n```\n\n### TinyTeX\n\nTeX distribution binaries for LaTeX support.\n\nContains `pdflatex` required by `R CMD check` and for building R from source.\n\n```batchfile\nC:\\Users\\%USERNAME%\\AppData\\Roaming\\TinyTeX\\bin\\windows\n```\n\n### MiKTeX\n\nTeX distribution binaries for LaTeX support.\n\nContains `pdflatex` required by `R CMD check` and for building R from source.\n\nMiKTeX installed via `choco install miktex` or standalone installer (all users):\n\n```batchfile\nC:\\Program Files\\MiKTeX\\miktex\\bin\\x64\n```\n\nMiKTeX installed via standalone installer (current user):\n\n```batchfile\nC:\\Users\\%USERNAME%\\AppData\\Local\\Programs\\MiKTeX\\miktex\\bin\\x64\n```\n\n### Pandoc\n\npandoc installed via `choco install pandoc` or standalone installer:\n\n```batchfile\nC:\\Users\\%USERNAME%\\AppData\\Local\\Pandoc\n```\n\npandoc distributed with RStudio Desktop (installer):\n\n```batchfile\nC:\\Program Files\\RStudio\\resources\\app\\bin\\quarto\\bin\\tools\n```\n\npandoc distributed with RStudio Desktop (zip):\n\n```batchfile\nC:\\Users\\%USERNAME%\\RStudio-`r sprintf(\"%s-%s\", rstudio_version_major, rstudio_version_minor)`\\resources\\app\\bin\\quarto\\bin\\tools\n```\n\npandoc distributed with Quarto installed via `choco install quarto`:\n\n```batchfile\nC:\\ProgramData\\chocolatey\\lib\\quarto\\tools\\bin\\tools\n```\n\npandoc distributed with Quarto installed via Quarto standalone installer:\n\n```batchfile\nC:\\Users\\%USERNAME%\\AppData\\Local\\Programs\\Quarto\\bin\\tools\n```\n\n### Quarto\n\nQuarto installed via `choco install quarto`:\n\n```batchfile\nC:\\ProgramData\\chocolatey\\lib\\quarto\\tools\\bin\n```\n\nQuarto installed via Quarto standalone installer:\n\n```batchfile\nC:\\Users\\%USERNAME%\\AppData\\Local\\Programs\\Quarto\\bin\n```\n\nQuarto distributed with RStudio Desktop (installer):\n\n```batchfile\nC:\\Program Files\\RStudio\\resources\\app\\bin\\quarto\\bin\n```\n\nQuarto distributed with RStudio Desktop (zip):\n\n```batchfile\nC:\\Users\\%USERNAME%\\RStudio-`r sprintf(\"%s-%s\", rstudio_version_major, rstudio_version_minor)`\\resources\\app\\bin\\quarto\\bin\n```\n\n### Git\n\nFor interacting with Git repositories.\n\nGit for Windows installed via `choco install git` or standalone installer:\n\n```batchfile\nC:\\Program Files\\Git\\cmd\n```\n\n## Configure and verify\n\n1. Locate the paths on your system.\n   - Open File Explorer and navigate to the directories listed above.\n   - Verify that the paths exist and contain the expected executables.\n1. Add relevant paths to your system's `PATH` environment variable\n   and verify the setup.\n   - For a step-by-step guide with screenshots, see\n     [how to set the `PATH` environment variable in Windows](path.md).\n\nNow you should be able to use R and its associated tools from the CLI\nwithout specifying full paths.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanxstats%2Fr-windows-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnanxstats%2Fr-windows-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnanxstats%2Fr-windows-paths/lists"}