---
title: "Installation"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Installation}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

Install `httpgd` from CRAN:

```R
install.packages("httpgd")
```

Or get the latest development version from GitHub:

```R
remotes::install_github("nx10/httpgd")
```

See [system requirements](#System-requirements) for troubleshooting.

## System requirements

Depends on `R` version &geq; 4.0 on windows, and R &geq; 3.2 on linux and macOS (a C++ compiler with basic C++17 support [is required](https://github.com/nx10/httpgd/issues/56)).

Note that there is a rare bug in R versions < 4.1, that leads to [some plots disappearing when ggplot2 plots are resized and deleted in a specific way](https://github.com/nx10/httpgd/issues/50).

`libpng` and X11 are required on unix like systems (e.g. Linux, macOS). 
`Cairo` is required on unix like systems to enable PNG, PDF, EPS and PS renderers.

### macOS

If `libpng` is missing install it via:

```sh
brew install libpng
```

If `X11` is missing the error message will include the text:

```sh
unable to load shared object [...] systemfonts/libs/systemfonts.so [...]
```

Install [`XQuartz`](https://www.xquartz.org/).
(see: <https://github.com/r-lib/systemfonts/issues/17>)

### Linux

For source installation on Linux, the fontconfig freetype2 library is required to install the `{systemfonts}` package, which is a dependency of `httpgd`.

#### Debian, Ubuntu, etc.

```sh
apt install libfontconfig1-dev
```

#### Fedora, CentOS, RHEL, etc.

```sh
dnf install fontconfig-devel
```
