mattmar / rasterdiv Goto Github PK
View Code? Open in Web Editor NEWDiversity Indices for Numerical Matrices
Home Page: https://mattmar.github.io/rasterdiv/
Diversity Indices for Numerical Matrices
Home Page: https://mattmar.github.io/rasterdiv/
I have a RasterLayer that contains NDVI values and I have a sampling grid as a SpatialPolygonsDataFrame. Here are the details of those two objects:
NDVI_ext
class : RasterLayer
dimensions : 2716, 2880, 7822080 (nrow, ncol, ncell)
resolution : 3.125, 3.125 (x, y)
extent : 270084.4, 279084.4, 1764175, 1772663 (xmin, xmax, ymin, ymax)
crs : +proj=utm +zone=16 +datum=WGS84 +units=m +no_defs
source : memory
names : layer
values : 0.4966216, 0.9459583 (min, max)
NDVI_spdf
class : SpatialPolygonsDataFrame
features : 232
extent : 270084.4, 279084.4, 1764175, 1772663 (xmin, xmax, ymin, ymax)
crs : +proj=utm +zone=16 +datum=WGS84 +units=m +no_defs
variables : 1
names : ID,
min values : 1,
max values : 232,
I want to calculate Rao's Q inside each cell of the grid using the field "ID", analogous to the use of the "CONTINENT" field shown in the example vignette (https://mattmar.github.io/rasterdiv/articles/rasterdiv_area_based_Rao.html). But when I do this, I receive an error:
paRao( x=NDVI_ext, area=NDVI_spdf, field='ID', window=9 )
Error in combn(p, m = 2, FUN = prod, na.rm = TRUE) : n < m
Is there a clear solution to this problem? I suspect there is an alternative approach in uses raster::extract to apply the paRao
function to each sample unit in the grid, but it's not obvious how to do this either because of the moving window.
Any advice about this issue would be helpful. I am also new to posting to Issues so if this is not the appropriate venue or format, do let me know.
I am able to run Shannon, Renyi, or Roa on an EVI2 raster without np but get the following if I run np = 6 (my workstation has 6 cores):
Object x check OK:
Shannon output matrix will be returned.
################ Starting parallel calculation ##################
Error in registerDoParallel(cls) : could not find function "registerDoParallel"
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.