An open API service indexing awesome lists of open source software.

https://github.com/landscitech/pfocal

Fast parallel convolution in R.
https://github.com/landscitech/pfocal

convolution image-processing landscape-ecology r raster-data

Last synced: 8 months ago
JSON representation

Fast parallel convolution in R.

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
set.seed(77)
```

# pfocal

[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](http://www.gnu.org/licenses/gpl-3.0)
[![Project Status: Active](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![R-CMD-check](https://github.com/LandSciTech/pfocal/workflows/R-CMD-check/badge.svg)](https://github.com/LandSciTech/pfocal/actions)
[![Codecov test coverage](https://codecov.io/gh/LandSciTech/pfocal/branch/master/graph/badge.svg)](https://app.codecov.io/gh/LandSciTech/pfocal?branch=master)

The goal of `pfocal` is to implement fast parallel convolution. R version >= 4.0.0 is required.

## Installation

You can install the package as such:

```{r, eval=FALSE}
# From CRAN
install.packages("devtools")

# Dev version from GitHub
devtools::install_github("LandSciTech/pfocal")
```

## Example

```{r}
library(pfocal)

data <- matrix(nrow = 100, ncol = 100,
data = runif(n = 100*100, min = 0, max = 10))
image(data, asp = 1)
```
```{r}
kernel <- exponential_kernel()
convoluted <- pfocal(data = data, kernel = kernel, edge_value = 0)
image(convoluted, asp = 1)
```