|
5 | 5 | "title": "Git, GitHub & RStudio",
|
6 | 6 | "description": "RStudio users can leverage git Version control to enhance reproducibility.",
|
7 | 7 | "author": [],
|
8 |
| - "contents": "\r\nThe usethis\r\npackage and the RStudio IDE will help you orchestrate your version\r\ncontrol repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have\r\nthe latest versions of R, RStudio, and usethis. Then, setup your RStudio\r\nconfiguration using two key documents: Setup,\r\nand Managing\r\nGit(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from\r\nlocal\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\n# Before next step → stage & commit changes\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nRename default branch\r\n\r\n\r\nlibrary(usethis)\r\ngit_default_branch()\r\ngit_default_branch_rename()\r\ngit_default_branch_rediscover()\r\n\r\n\r\n\r\nset-up git and manage\r\nGitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"jane@example.com\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code\r\ncitable by connecting your GitHub repo and your ORCID (unique author ID) through\r\nto the Zenodo archival repository.\r\nNow, every time you commit a milestone release, you also mint a DOI.\r\nShare a zero-install\r\ncompute environment\r\n\r\nPublish your code in a binder.org container\r\n\r\n\r\n\r\n\r\n\r\n\r\nEverything you need is exemplified in binder-example for R that you\r\ncan find on\r\ngithub\r\nThe key elements are an install.R and\r\nruntime.txt files. The content and format of each file is\r\ndemonstrated properly at the GitHub repo. Browse and you will see.\r\nStep 1\r\n\r\n\r\n\r\nCreate an install.R file and store it in the RStudio\r\nProject’s root directory. Follow the example at https://github.com/binder-examples/r \r\n\r\nThis file should consist of install functions for each package used\r\nin your R code. If you’re not sure what packages you’re using, try\r\nrunning holepunch::write_compendium_description() and you\r\nwill find the details listed in the DESCRIPTION file under the ‘Depends’\r\nand ‘Remotes’ sections. IMPORTANT: Delete the\r\nDESCRIPTION file Before launching the binder build. In my\r\nexperience the DESCRIPTION file will conflict with the binder’s build\r\nprocess. For non-CRAN packages – specifically packages installed\r\nfrom GitHub – I recommend using the format:\r\nremotes::install_github(\"gadenbuie/countdown\") for each\r\npackage that is not on CRAN. CRAN packages can follow the format:\r\ninstall.packages(\"dplyr\")\r\n\r\nCreate a runtime.txt file and store it in the RStudio\r\nProject’s root directory Follow the example at https://github.com/binder-examples/r \r\n\r\nNote: If you try using holepunch, it will store these\r\nfiles in a .binder subdirectory. In my experience this will\r\ncause the binder build to fail. For this reason, I don’t recommend using\r\nholepunch and I do recommend storing the two files in the project’s root\r\ndirectory.\r\n\r\nStep 2\r\nGenerate a binder badge with\r\nusethis::use_binder_badge(urlpath = \"rstudio\"). This should\r\nstore the badge in your GitHub’s project README file. Then\r\ncommit and push your changes to GitHub; go to\r\nthe README on GitHub, launch the build and wait for the long\r\nlaunch/build time.\r\nHint: be prepared to wait. The first build can take some time.\r\nSometimes you must launch an initial or dormant build more than once. In\r\nmy experienced these hiccups are rare, but try the launch twice before\r\ngetting involved in extensive troubleshooting.\r\n\r\n\r\n\r\nThe old documentation from this site can be found in the v.0.2019\r\nrelease on GitHub.\r\n\r\n\r\n\r\n", |
9 |
| - "last_modified": "2022-04-26T14:46:19-04:00" |
| 8 | + "contents": "\r\nThe usethis\r\npackage and the RStudio IDE will help you orchestrate your version\r\ncontrol repositories as RStudio projects.\r\n\r\n\r\n\r\n\r\n\r\n\r\nSetup\r\nTo get started, make a free GitHub.com account. Make sure you have\r\nthe latest versions of R, RStudio, and usethis. Then, setup your RStudio\r\nconfiguration using two key documents: Setup,\r\nand Managing\r\nGit(Hub) Credentials.\r\nTips\r\nClone or fork from GitHub\r\n\r\n\r\nusethis::create_from_github(\"https://github.com/data-and-visualization/git-tutorial\")\r\n\r\n\r\n\r\nCreate the GitHub repo from\r\nlocal\r\n\r\n\r\nlibrary(usethis)\r\nuse_git() # initialize a git repo\r\nuse_git_ignore()\r\nuse_readme.Rmd()\r\nuse_ccby_license()\r\n# Before next step → stage & commit changes\r\nuse_github() # Connect local repo to GitHub\r\n\r\n\r\n\r\nRename default branch\r\n\r\n\r\nlibrary(usethis)\r\ngit_default_branch()\r\ngit_default_branch_rename()\r\ngit_default_branch_rediscover()\r\n\r\n\r\n\r\nset-up git and manage\r\nGitHub credentials\r\n\r\n\r\n# Sign-in to your GitHub account\r\n# Read: https://usethis.r-lib.org/articles/articles/git-credentials.html\r\n# Read: https://usethis.r-lib.org/articles/articles/usethis-setup.html\r\nusethis::create_github_token()\r\ngitcreds::gitcreds_set()\r\ngh::gh_whoami()\r\nusethis::git_sitrep()\r\nusethis::use_git_config(user.name = \"Jane Doe\", user.email = \"jane@example.com\")\r\nusethis::git_sitrep()\r\n\r\n\r\n\r\nNext Level…\r\nTake your reproducibility to the next level. Make your code\r\ncitable by connecting your GitHub repo and your ORCID (unique author ID) through\r\nto the Zenodo archival repository.\r\nNow, every time you commit a milestone release, you also mint a DOI.\r\nShare a zero-install\r\ncompute environment\r\n\r\nPublish your code in a binder.org container\r\n\r\n\r\n\r\n\r\n\r\n\r\nEverything you need is exemplified in binder-example for R that you\r\ncan find on\r\ngithub\r\nThe key elements are an install.R and\r\nruntime.txt files. The content and format of each file is\r\ndemonstrated properly at the GitHub repo. Browse and you will see.\r\nStep 1\r\n\r\n\r\n\r\nCreate an install.R file and store it in the RStudio\r\nProject’s root directory. Follow the example at https://github.com/binder-examples/r \r\n\r\nThis file should consist of install functions for each package used\r\nin your R code. If you’re not sure what packages you’re using, try\r\nrunning holepunch::write_compendium_description() and you\r\nwill find the details listed in the DESCRIPTION file under the ‘Depends’\r\nand ‘Remotes’ sections. IMPORTANT: Delete the\r\nDESCRIPTION file Before launching the binder build. In my\r\nexperience the DESCRIPTION file will conflict with the binder’s build\r\nprocess. For non-CRAN packages – specifically packages installed\r\nfrom GitHub – I recommend using the format:\r\nremotes::install_github(\"gadenbuie/countdown\") for each\r\npackage that is not on CRAN. CRAN packages can follow the format:\r\ninstall.packages(\"dplyr\")\r\n\r\nCreate a runtime.txt file and store it in the RStudio\r\nProject’s root directory Follow the example at https://github.com/binder-examples/r \r\n\r\nNote: If you try using holepunch, it will store these\r\nfiles in a .binder subdirectory. In my experience this will\r\ncause the binder build to fail. For this reason, I don’t recommend using\r\nholepunch and I do recommend storing the two files in the project’s root\r\ndirectory.\r\n\r\nStep 2\r\nGenerate a binder badge with\r\nusethis::use_binder_badge(urlpath = \"rstudio\"). This should\r\nstore the badge in your GitHub’s project README file. Then\r\ncommit and push your changes to GitHub; go to\r\nthe README on GitHub, launch the build and wait for the long\r\nlaunch/build time.\r\nHint: be prepared to wait. The first build can take some time.\r\nSometimes you must launch an initial or dormant build more than once. In\r\nmy experienced these hiccups are rare, but try the launch twice before\r\ngetting involved in extensive troubleshooting.\r\n\r\n\r\n\r\nThe old documentation from this site can be found in the v.0.2019\r\nrelease on GitHub.\r\n\r\n\r\n\r\n", |
| 9 | + "last_modified": "2022-04-29T11:31:26-04:00" |
10 | 10 | },
|
11 | 11 | {
|
12 | 12 | "path": "resources.html",
|
13 | 13 | "title": "Resources",
|
14 | 14 | "author": [],
|
15 | 15 | "contents": "\r\nSlides\r\nResearch\r\nReproducibility, 2021\r\nSocial Coding Sites\r\nhttps://github.com\r\nhttps://gitlab.com\r\nhttps://bitbucket.org\r\nDuke’s GitLab\r\nInstance\r\nManaging SSH\r\nkeys\r\n\r\nGUI Git Clients\r\nRStudio – Free. Great for\r\nuseRs\r\nSublime’s Merge –\r\nDownloaded and evaluated for free. $100 / 3-years of upgrades.\r\nGitKracken – Free if you have the GitHub Student Pack or the\r\nGitHub\r\nTeacher toolbox\r\nSourceTree – Free.\r\n(defaults to use with BitBucket)\r\nPackages\r\nhttps://usethis.r-lib.org/\r\nholepunch\r\nto make your reproducible code a container on binder.org\r\nFree Book\r\nHappy Git and GitHub for the\r\nuseR\r\nHandy Article\r\n10\r\nCommon Problems / Solutions\r\nReproducibility\r\nWriting\r\nclear code: Tools for Reproducible Research\r\nInitial Steps Toward\r\nReproducible Research\r\nMaking your research reproducible with TIER + R + GitHub Slides. Cetinkaya-Rundel, M. (2016). Open Science\r\nFramework. Retrieved from https://osf.io/phyau\r\n\r\n\r\n\r\n",
|
16 |
| - "last_modified": "2022-04-26T14:46:21-04:00" |
| 16 | + "last_modified": "2022-04-29T11:31:27-04:00" |
17 | 17 | },
|
18 | 18 | {
|
19 | 19 | "path": "ssh_keys.html",
|
20 | 20 | "title": "Configuring SSH Keys & Credentials",
|
21 | 21 | "description": "Use SSH keys to configure RStudio projects with https://GitLab.OIT.Duke.edu",
|
22 | 22 | "author": [],
|
23 | 23 | "contents": "\r\nThe instructions below are based on those found at Duke’s GitLab. If\r\nthe instructions below are not clear you should consult the more\r\ncomplete GitHub instructions to generate\r\nand add an SSH key\r\nYou will need Git installed locally. To verify, Open a Terminal\r\nand type: git --version. If you do not get a response with\r\na version number, seek help for installing Git\r\nTo begin, open the Terminal in RStudio.\r\nIf you’re using the latest version of RStudio, the Terminal is\r\na tab in the console quadrant (typically the bottom-left)\r\nIn RStudio: Menubar\r\nTools > Terminal > New Terminal\r\n\r\n\r\nDetermine if you already have an SSH key pair. In the\r\nTermnal tab, type: cat ~/.ssh/id_rsa.pub\r\nIf you see a string starting with ssh-rsa you\r\nalready have an SSH key pair and can simply copy that key (Step\r\n5)\r\nIf you get some kind of error, you’ll have to generate a key in\r\nthe next step\r\n\r\nIn the Terminal tab, type:\r\nssh-keygen -t rsa -C \"your.email@example.com\" -b 4096\r\nI recommend using your Duke Email address but it must be the address\r\nyou used to create your GitHub account\r\n\r\nYou will be prompted to input a file path. i.e. the location\r\nwhere you’ll save your SSH key pair.\r\nIf you don’t already have an SSH key pair use the suggested path\r\nby pressing enter\r\nAfter setting the file path you will be prompted to input a\r\npassword. This will secure your SSH key pair. It is a best practice to\r\nuse a password for an SSH key pair, but it is not required. You can skip\r\ncreating a password by pressing enter\r\nNote: If you want to change the password of your\r\nSSH key pair, you can use\r\nssh-keygen -p <keyname>\r\n\r\n\r\nCopy the public SSH key to the clipboard buffer\r\nIn the Termnal tab, type the appropriate code below:\r\nmacOS:\r\ncat ~/.ssh/id_rsa.pub | pbcopy\r\nWindows:\r\ncat ~/.ssh/id_rsa.pub | clip\r\n\r\n\r\nThe final step is to add your public SSH key to GitHub.\r\nNavigate to the SSH and GPG keys section of your GitHub\r\nSettings. Click the green New SSH key button\r\nand paste your key in the Key section. Give the key a relevant\r\nTitle Use an identifiable title like Work Laptop - Windows\r\n7 or Home MacBook Pro 15.\r\nIf you manually copied your public SSH key make sure you copied\r\nthe entire key starting with ssh-rsa and ending with your\r\nemail.\r\n\r\nWorkflow\r\nOnce you have configured your SSH keys\r\nCreate a repository at https://GitLab.oit.duke.edu\r\nClone the repo via RStudio > New Project … > Version Control\r\n> Git\r\nRestart RStudio ; look for a Git tab near the\r\nEnvironment tab\r\n\r\n\r\n\r\n",
|
24 |
| - "last_modified": "2022-04-26T14:46:22-04:00" |
| 24 | + "last_modified": "2022-04-29T11:31:28-04:00" |
25 | 25 | }
|
26 | 26 | ],
|
27 | 27 | "collections": []
|
|
0 commit comments