[R-sig-Geo] hist() in raster package

Agustin Lobo alobolistas at gmail.com
Wed Feb 10 09:01:10 CET 2010


Robert,

I'm using
 > packageDescription("raster")
Package: raster
Type: Package
Title: Geographic analysis and modeling with raster data
Version: 0.9.9-14
Date: 8-Febrary-2010

(Maybe I should wait few more hours to get the fixed version?
The date above seems earlier than your message, but just to let you
know in case this is a really pending issue, as you were mentioning 0.9.9-14)

on a linux machine now and still have problems
 > a <- hist(r,plot=F,maxnsample=100)
 > a
NULL

also, the graphic window gets opened although
no graphic is plotted.


Thanks for you help.

Agus

Robert J. Hijmans wrote:
> Hello Agus,
> 
> You did not do anything wrong. I did. This has been fixed in version
> 0.9.9-14 and hist now returns a histogram object (invisibly if plot =
> TRUE) or a list of such objects.
> 
> Development of pkg RemoteSensing is currently a bit slow and the code
> unorganized, but I think it will get more active again soon.
> 
> Robert
> 
> 
> 
> On Tue, Feb 9, 2010 at 5:32 AM, Agustin Lobo <alobolistas at gmail.com> wrote:
>> Hi!
>> I'm confused by the following
>>> r <- brick("SDIM0069.tif")
>>> nlayers(r)
>> [1] 3
>>
>> Then I do
>>> hist(r)
>> and get 3 histograms plotted, but I do:
>>> a <- hist(r,plot=F)
>> and object a seems to hold the histogram of only one layer (actually,
>> the 3rd one):
>>> str(a)
>> List of 7
>>  $ breaks     : num [1:19] 0 5 10 15 20 25 30 35 40 45 ...
>>  $ counts     : int [1:18] 337 1131 1280 1172 951 815 808 827 741 636 ...
>>  $ intensities: num [1:18] 0.00675 0.02264 0.02563 0.02346 0.01904 ...
>>  $ density    : num [1:18] 0.00675 0.02264 0.02563 0.02346 0.01904 ...
>>  $ mids       : num [1:18] 2.5 7.5 12.5 17.5 22.5 27.5 32.5 37.5 42.5 47.5 ...
>>  $ xname      : chr "values"
>>  $ equidist   : logi TRUE
>>  - attr(*, "class")= chr "histogram"
>>
>> Am I doing something wrong?
>>
>> Thanks
>>
>> Agus
>>
>> PS. Is package RemoteSensing being under active development?
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>



More information about the R-sig-Geo mailing list