Installing and Updating ArabBarometR
Installing ArabBaromtR
If you do not have the ArabBarometR
package, you can install it on your machine in one of two ways. It is highly recommend you follow the first method.
Installing from GitHub
This is the recommended way to install ArabBarometR
.
- You will need a GitHub Personal Access Token (PAT). You will only need to do this step once.
- GitHub has updated their security measures. Your PAT will generally take the place of your password. To create one, click here. Click the button that says Generate new token. Select the permissions you want to token to be accountable for. Once you’ve made your selections, click Generate token.
- Once you have your PAT, save it somewhere (1) secure and (2) easily accessible (to you). You cannot recover your PAT if you lose it. You can make a new one, but then you have to reset everything and it’s a big pain. You can save yor PAT (and other sensitive information) in R using the
keyring
package if you are so inclined. Here is a link to a tutorial. - This bookdown section does a great job of explaining PATs in minimal and expansive detail. The book overall is an excellent source for information on Git and R.
- Make you have
devtools
installed in R. If not, useinstall.packages("devtools")
. - Now, you can install
ArabBarometR
directly from GitHub! Use the following command:devtools::install_github("Arab-Barometer/ArabBarometR", ref = "main", auth_token = "your_PAT", dependencies = T)
- In this case,
"your_PAT"
is the PAT you created in step 1. - The last parameter specification,
dependencies = T
, installs all the packages that are required to runArabBarometR
.- Tip: you can also use this parameter whenever you install any R package the “normal” way with
install.packages()
.
- Tip: you can also use this parameter whenever you install any R package the “normal” way with
ArabBarometR
is now installed everywhere on your computer. Usinglibrary(ArabBarometR)
will call the latest version of the package.
Downloading from GitHub
- To download the latest version of this package, click the green code button towards the top of the
ArabBarometR
repo page. - From the list of options, select Download ZIP.
- Save the zip file somewhere you will not loose it.
- If you are downloading this not for the first time, I suggest saving it on top of where you saved the old file. That way you will only have one version of the package on your computer and will not become confused as to which package to use.
- Unzip the file.
- Open
ArabBarometR.Rproj
. - In the top right pane, click on the tab that says Build.
- In the Build tab, click on Install and Restart.
- Install any packages that are required.
- The latest
ArabBarometR
is now on your computer. - The next time you open R, type
install.packages("ArabBarometR")
into the console. ArabBarometR
is now installed everywhere on your computer. Usinglibrary(ArabBarometR)
will call the latest version of the package.
Updating ArabBarometR
To check which version you have, you can use utils::packageVersion("ArabBarometR")
.
Updating via install_github
This is the recommended way to update your version of ArabBarometR
when minor revisions and patches occur. It is only accessible if you followed have a PAT from GitHub.
- You can update
ArabBarometR
directly from GitHub! Use the following command:devtools::install_github("Arab-Barometer/ArabBarometR", ref = "main", auth_token = "your_PAT", dependencies = T, upgrade = "always")
- In this case,
"your_PAT"
is the PAT you created in step 1. - The last parameter specification,
dependencies = T
, installs all the packages that are required to runArabBarometR
.
That’s it! Your package is updated.
Updating via downloads
To update the package via downloading it, follow the exact same steps as installing it.
- To download the latest version of this package, click the green code button towards the top of the
ArabBarometR
repo page. - From the list of options, select Download ZIP.
- Save the zip file somewhere you will not loose it.
- If you are downloading this not for the first time, I suggest saving it on top of where you saved the old file. That way you will only have one version of the package on your computer and will not become confused as to which package to use.
- Unzip the file.
- Open
ArabBarometR.Rproj
. - In the top right pane, click on the tab that says Build.
- In the Build tab, click on Install and Restart.
- Install any packages that are required.
- The latest
ArabBarometR
is now on your computer. - The next time you open R, type
install.packages("ArabBarometR")
into the console. ArabBarometR
is now installed everywhere on your computer. Usinglibrary(ArabBarometR)
will call the latest version of the package.