motif: an open-source R tool for pattern-based spatial analysis
Context: Pattern-based spatial analysis provides methods to describe and quantitatively compare spatial patterns for categorical raster datasets. It allows for spatial search,change detection, and clustering of areas with similar patterns. Objective: We developed an R package motif as a set of open-source tools for pattern-based spatial analysis. Methods: This package provides most of the functionality of existing software (except spatial segmentation), but also extends the existing ideas through support for multi-layer raster datasets. It accepts larger-than-RAM datasets and works across all of the major operating systems. Results: In this study, we describe the software design of the tool, its capabilities, and present four case studies. They include calculation of spatial signatures based on landcover data for regular and irregular areas, search for regions with similar patterns of geomorphons, detection of changes in land cover patterns, and clustering of areas with similar spatial patterns of land cover and landforms. Conclusions: The methods implemented in motif should be useful in a wide range of applications, including land management, sustainable development, environmental protection, forest cover change and urban growth monitoring, and agriculture expansion studies. The motif package homepage is https://nowosad.github.io/motif.