# Rogers suggestion was
library(RColorBrewer)
bl5 <- brewer.pal(5, "Blues")
mypal <- colorRampPalette(bl5)
# but he was saying any method of getting a list of colours is OK
rev(mypal(256))
rainbow(256)
colorRampPalette(c("lightblue","navy"))(256)
# then your example
library(spatstat)
Sebastian:
I assume you were thinking of calculating distances of points recorded
with longitude and latitude? If that's the case, then it's an arc
distance of a Great Circle. This article on wikipedia summarizes what
the formula are, and you can code the formula in R very reasonably:
http://
Hi Edzer,
I am still having some trouble with the great distance calculations in
'variogram'. Your suggestion below works, but the distances are not correct
(at least, not in kilometers, meters, or miles). I do not have proj.4 or gdal
libraries installed, nor do I have the R packages proj4 or
This works great, Edzer. I expected there was a simple solution. Many thanks!
-Tim
On Wed, Apr 2008, 30 at 07:42:36AM +0200, Edzer Pebesma wrote:
> Timothy, for some reason the projected argument was not meant to be set
> by users at this level of abstraction; I'll look into it. The following
Maybe this synthesis of both replies can help you:
library(RColorBrewer)
bl5 <- brewer.pal(5, "Blues")
mypal <- colorRampPalette(bl5)
library(spatstat)
data(longleaf)
Z <- smooth.ppp(longleaf)
plot(Z)
plot(Z, col=mypal(12))
#or
plot(Z, col=rev(mypal(12)))
Regards,
Marcelino
At 20: