Hi all,
This is a bit general question. I've searched the web but I haven't
gotten a consistent answer.
I've used a digital elevation model to produce another raster with
aspect data by using 'terrain{rater}'.
Aspect data ranges from 0 to 360 degrees. In the vignette of the raster
package
Good catch.
I have no solution -- but I get the same problem on an earlier version of R
in a different environment (so it is not just because of your setup).
My session info is below.
Cheers,
Gareth.
sessionInfo()
R version 3.0.1 (2013-05-16)
Platform: x86_64-unknown-linux-gnu (64-bit)
I'm not 100% sure what you mean -- but it sounds like could try running
'spDists' on the tree's coordinates, which will return a distance matrix for
the trees (i.e. all pairwise distances). Then for each row, you could find
the indices which are your distance threshold -- this should tell you the
Try this
library(sp)
# Hypothetical point coordinates -- 20 points in total, in a 'unit box'
mycoords=cbind(runif(20),runif(20))
# Chosen distance threshold for 'neighbours'
mythresh=0.2
# Distance matrix
myDists=spDists(mycoords)
# Compute neighbours -- store result in a list
# NOTE: All
Hi Phil,
I have also found readOGR to be very slow when reading a large shapefile (in
my case, a shapefile with 85000 polygons and ~ 200 columns in the attribute
table).
In my case, I would repeatedly re-read the shapefile each time I was working
on the script.
To speed things up, I found it
For RasterLayer objects, I think you need to use 'maxValue' and 'minValue'
instead of max and min
--
View this message in context:
http://r-sig-geo.2731867.n2.nabble.com/Error-message-in-calc-tp7584795p7584796.html
Sent from the R-sig-geo mailing list archive at Nabble.com.
Apologies the last suggestion was totally wrong, since 'calc' applies the
function to each cell (represented as a vector).
However, the problem might be that the 'which' function inside your 'fun1'
is sometimes returning more than one value. In that case, you might try
forcing 'w' to have the
I think that is covered in this question (?):
http://gis.stackexchange.com/questions/44387/use-proj4-to-specify-robinson-projection-with-r-ggmap-and-ggplot2-packages
--
View this message in context:
# Something like
library(maptools)
data(wrld_simpl)
plot(wrld_simpl,border=NA,col='blue',axes=T, xlim=c(100,130),
ylim=c(-40,30))
par(plt = c(0.2, 0.5, 0.6, 0.8), new = TRUE)
plot(wrld_simpl,border=NA,col='green',bg='white',axes=F)
# If you put axes on the inset, they will fall over the
I had related situation with 85000 non-overlapping polygons, and a raster
dataset with dimensions ~ 1x1. In that case I wanted the full
distribution of pixel values inside each polygon, rather than just the mean.
An efficient approach (much faster than extract) was:
1) Rasterize the
10 matches
Mail list logo