Currently harp is only available on linux.

Install harp with ansible

You can install harp through an ansible script. This will check if R, RStudio, the necessary system libraries and R libraries are installed, and then install anything that is missing. First update the system’s list of resources.

sudo apt update

Then install ansible with the command

sudo apt install ansible

Download the file install_r_harp.txt, but save it with a .yml extension instead of .txt. Before you run it, ensure that you use the latest version of RStudio in the line

rstudio_deb_version: 2022.07.2-576

You can find what the latest version is at the RStudio webpages.

Then run the command

ansible-playbook install_r_harp.yml

If you are not comfortable with ansible, follow the steps to installing harp manually.

Install harp manually

We will often use harp with an R library called tidyverse. They are both dependent on system libraries. To install these, open the terminal.

ubuntu terminal

Update the package list from your distro's software repository with the latest versions with the command

sudo apt update

Install the libraries as indicated.

sudo apt install libproj-dev
sudo apt install libcurl4-openssl-dev
sudo apt install libxml2-dev
sudo apt install libnetcdf-dev
sudo apt install libssl-dev

Have a look at instructions for installing R if it is not installed already. Ensure that you follow the instructions for the version of ubuntu that you use. Also pay attention to the part explaining how to ensure that the newest version of R is installed.

RStudio (Desktop) is convenient. I prefer downloading the .deb file, which is then installed by running in terminal

sudo gdebi rstudio-2022.07.2-576-amd64.deb

If gdebi is not already installed, it can be done by running in terminal

sudo apt install gdebi

harp is only available on github, so to be able to install it, you must install the packages remotes. Also install the package tidyverse. In R or RStudio run the command

install.packages("remotes")
install.packages("tidyverse")

r install remotes package

It may be beneficial to install some of the harp packages individually, in this order:

remotes::install_github("harphub/meteogrid")
remotes::install_github("harphub/harpIO")
remotes::install_github("harphub/harpPoint")
remotes::install_github("harphub/harpVis")
remotes::install_github("harphub/harp")

r install meteogrid package

If you encounter a problem with API rate limit exceeded you just have to wait until the reset time (it is in UTC ), before retrying to install. This is typically a 15 minutes wait.