Hot answers tagged

2

To get the distribution of NA/non-NA, use table on the values of the raster. Test raster: > r = raster() Fill with 1 to N: > r[] = 1:ncell(r) Set some cells to NA: > r[sample(ncell(r),ncell(r)/5)]=NA To count NA/non-NA, use table: > table(is.na(r[])) FALSE TRUE 51840 12960 To plot this with NA in red, do: plot(r, colNA="red")


2

A RAT is just a table that crosswalks the numeric values contained in an integer raster to descriptive attributes. It is not realistic to have a RAT for a true floating-point raster (eg., elevation) and really does not make much sense to. If one wants to represent a process as nominal than you just reclassify it into the desired ranges. A good way to ...


2

Are you looking for something like st_relate which implements the DE9-IM relation scheme? https://en.wikipedia.org/wiki/DE-9IM This tells you how the exterior, boundary, and interior of two features relate to each other. For example two polygons that only touch at a point have no interior-interior relation (which is coded as F) and a point dimension ...


2

It looks like your problem is that the polygon data is multipart geometry. This means that you have multiple features (polygons) associated with single rows (attributes). Even if raster::extract works, this makes very little sense from a results standpoint. For your data to match, you need to explode your geometry into single part. Here is an example, you ...


1

You can build legends with the legend function, for example with your data this looks okay: legend(1, 1.5, legend=c("Houses","Inner","Outer"), col=c("black","green","red"), lwd=2,horiz=TRUE) check the help and adjust parameters to suit. It is quite flexible.


1

First, you are using a double bracket where you do not need to and second, it is often better to use a numeric index. library(modifiedmk) x <- c(Nile) Here, if you use a single bracket it returns the desired statistic. pwmk(x)["P-value"] Now, if you use a numeric index you can simplify things a bit. This returns the: "P-value", "Z-value", "Sen's ...


Only top voted, non community-wiki answers of a minimum length are eligible