Simulation of Cropland Data Layer Products from the USDA

Provides tools to simulate categorical raster data, including objects from the 'terra' package. Functions focus on generating edge pixel values from reclassified raster data derived from the United States Department of Agriculture (USDA) Cropland Data Layer products.


cdlsim

R-CMD-check

The goal of cdlsim is to simulate USDA CDL data to quantify the sensitivity of metrics calculated on it. The R package landscapemetrics is used to implement popular FRAGSTATS style metrics in R.

Installation

The stable release of cdlsim will be available from CRAN soon:

install.packages("cdlsim")

Until then, you can install the development version of cdlsim from GitHub with:

# install.packages("devtools")
devtools::install_github("burgerhaley97/cdlsim")

Example Usage

This is a basic example which shows how a simple landscape would behave in our simulation:

library(cdlsim)

Create a small raster

r <- rast(nrows = 20, ncols = 20) values(r) <- rep(1:3, length.out = ncell(r))

Simple transition matrix

trans_mat <- matrix(1/3, nrow = 3, ncol = 3) rownames(trans_mat) <- colnames(trans_mat) <- c("1", "2", "3")

Simulation example

simulate_raster_patch(r, trans_mat, iterations = 1)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("cdlsim")

0.1.0 by Haley Burger, 6 months ago


Browse source code at https://github.com/cran/cdlsim


Authors: Haley Burger [aut, cre, cph]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports dplyr, terra, landscapemetrics, readxl, utils, Rcpp

Suggests knitr, rmarkdown, testthat

Linking to Rcpp


See at CRAN