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

<!--Install `unigd` from CRAN:

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

Or get the latest development version from GitHub:
-->

You can install the development version of `unigd` from GitHub with:

``` r
# install.packages("remotes")
remotes::install_github("nx10/unigd")
```

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

## System requirements

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

### macOS

If `libpng` is missing install it via:

```sh
brew install libpng
```

If `Cairo` is missing install it via:

```sh
brew install cairo
```

If `libtiff` is missing install it via:

```sh
brew install libtiff
```

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 `unigd`.

#### Debian, Ubuntu, etc.

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

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

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

To support additional plot file formats (PDF, EPS, PS) optionally, the `Cairo` library is required.

#### Debian, Ubuntu, etc.

```sh
apt install libcairo2-dev
```

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

```sh
dnf install cairo-devel
```

To support additional TIFF formats optionally, the `libtiff` library is required.

#### Debian, Ubuntu, etc.

```sh
apt install libtiff-dev
```

#### Fedora, EPEL, etc.

```sh
dnf install libtiff-devel
```