Here is an example, with the mean in dotted red line and the median in
dotted blue line:
library(rasterVis)
f - system.file(external/test.grd, package=raster)
r - raster(f)
mn - cellStats(r, mean)
md - cellStats(r, median)
histogram(r) + layer(panel.abline(v = mn, col = red, lty = 2)) +
On Wed, 19 Nov 2014, 163 wrote:
Hello!
Now,the package rgdal not work in OS X Yosemite,how to replace?
If by not work, you mean that there is no CRAN binary for OSX Mavericks
and subsequent, please see:
https://stat.ethz.ch/pipermail/r-sig-mac/2014-April/010860.html
and later
Dear MailLister,
I have a problem with runGdal function in MODIS package. At Nadir the
resolution should be 250 m. The output of the following code result are NDVI,
EVI, composite day of the year and VI quality Tifs (resolution of 150 m)
library(MODIS)
runGdal( job=H12V12, product=MOD13Q1,
Nuno,
The hist function from the raster package uses a maximum of 100 000
values for generating the histogram
That is the default, but you do not have to use that. Did you read the
help file??
?raster::hist
Shows that you can set the maxpixels to any number you want. E.g.
maxpixels=Inf
if
Dear Amit,
if you set pixelSize asIn, the handling of the pixelsize is done by
gdal_translate, runGdal in such case does not provide any information about
resolution to used 'gdal_translate'.
As your outProj is 4326 you have geographic coordinates, this means that in
planar coordinates your
Hello!
Mr. Pascal, thank you, your suggestion works quite well.
First, I was having error calculating the median using the cellStats
because I was using brackets (median as opposed to median) and the error
message mislead me to think it was not implemented (which obviously I
obviously found very
cellStats will fail gracefully for very large rasters
do you know what is the limit of cells for that failure?
That depends on your computer hardware (RAM), software (32 or 64 bits
OS) and perhaps memory management (will RAM expand to hard disk if
needed?).
RH
On Wed, Nov 19, 2014 at 11:39
I managed to install rgdal from source on Yosemite by:
1) installing the GDAL 1.11 complete framework provided by kyngchaos.com;2)
pointing the right paths when building rgdal. This should work (type on system
terminal, not on R prompt):
R CMD INSTALL rgdal_0.9-1.tar.gz