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

Robert J. Hijmans r.hijmans at gmail.com
Tue Feb 9 20:08:33 CET 2010


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