Install the R package
Have a GitHub account and set up your GitHub credential in R
Create a repo for your R package and connect your local folder to your GH repo
See https://usethis.r-lib.org/reference/create_package.html for creating R package
See https://usethis.r-lib.org/reference/use_github.html for setting up git and github connections
Write your function definitions using
Use the function
- Just make the selection and you should be done if there was no errors during the process
The problem that I constantly encounter is during creating the branch
gh-pageswhere the website contents are stored and updated.
- A lot of time that there could be a error from GitHub side, called Error 500, which prevents to create the branch. In this case, you need to manually create the branch.
- The branch you want to create is called orphan branch, which means there is no contents in that branch. It is a little bit complicated to create a real orphan branch. Hence, I would recommend to create a new branch from your current branch and remove all the contents (files and folders) in that branch. If you are doing it locally, don’t forget to sync up your branch to your remote GH repo.
- Also, I highly doubt that it would cause trouble even if you didn’t remove all the contents from your
gh-pagesbranch. But I didn’t try.
- After creating the
gh-pagesmanually, run step 1 again. Overwrite pre-existing files if needed. It should work this time.