{"id":14070927,"url":"https://github.com/gadenbuie/snippets","last_synced_at":"2025-03-18T00:30:54.284Z","repository":{"id":55969589,"uuid":"147842781","full_name":"gadenbuie/snippets","owner":"gadenbuie","description":"My snippets for RStudio (or elsewhere)","archived":false,"fork":false,"pushed_at":"2021-11-04T02:17:47.000Z","size":32,"stargazers_count":23,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T05:57:53.796Z","etag":null,"topics":["r","rstats","rstudio","snippets"],"latest_commit_sha":null,"homepage":null,"language":"Vim Snippet","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gadenbuie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-07T15:35:30.000Z","updated_at":"2025-02-25T10:41:25.000Z","dependencies_parsed_at":"2022-08-15T10:31:20.925Z","dependency_job_id":null,"html_url":"https://github.com/gadenbuie/snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadenbuie%2Fsnippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadenbuie%2Fsnippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadenbuie%2Fsnippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gadenbuie%2Fsnippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gadenbuie","download_url":"https://codeload.github.com/gadenbuie/snippets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243893849,"owners_count":20364918,"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":["r","rstats","rstudio","snippets"],"created_at":"2024-08-13T07:08:11.468Z","updated_at":"2025-03-18T00:30:52.921Z","avatar_url":"https://github.com/gadenbuie.png","language":"Vim Snippet","funding_links":[],"categories":["Vim Snippet"],"sub_categories":[],"readme":"## Snippets for RStudio\n\nVarious custom snippets designed for RStudio, but possibly useful elsewhere.\n\nCopy the snippets into the correct language file from the **Global Options** \u003e **Code** \u003e **Edit Snippets** menu.\n\nOr use [dgrtwo/snippr](https://github.com/dgrtwo/snippr) to install:\n\n```r\n# remotes::install_github(\"dgrtwo/snippr\")\nlibrary(snippr)\n\n# For all snippets\nsnippets_install_github(\"gadenbuie/snippets\")\n\n# For just the R snippets\nsnippets_install_github(\"gadenbuie/snippets\", language = \"r\")\n\n# For just an individual snippet\nsnippets_install_github(\"gadenbuie/snippets\", language = \"r\", name = \"aa\")\n```\n\nFor manual installation, copy the snippets to `~/.R/snippets/r.snippets` or `~/.config/rstudio/snippets` for RStudio 1.3. (Windows uses a different directory that I don't know off the top of my head, sorry.). `usethis::edit_rstudio_snippets()` may provide better advice.\n\n```r\nlocal({\n  snippets_dir \u003c- fs::path_home(\".config\", \"rstudio\", \"snippets\")\n  fs::dir_create(snippets_dir) # make sure ~/.R/snippets exists\n\n  gh_base_url \u003c- \"https://raw.githubusercontent.com/gadenbuie/snippets/main/\"\n\n  for (snippet in paste0(c(\"r\", \"markdown\", \"css\", \"html\"), \".snippets\")) {\n    download.file(\n      paste0(gh_base_url, snippet),\n      fs::path(snippets_dir, snippet)\n    )\n  }\n})\n```\n\nYou may be able to find other useful snippets using [this GitHub search](https://github.com/search?q=in%3Apath+r.snippets+type%3Acode\u0026type=Code).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadenbuie%2Fsnippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgadenbuie%2Fsnippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgadenbuie%2Fsnippets/lists"}