[R] Summing values in an array

From: Patrick Dwyer <p.c.dwyer_at_gmail.com>
Date: Tue, 04 Mar 2008 10:18:29 +0200


Hi

I need to sum pixel values down through an HDF image cube (3D array once opened in R). The image cube is a time series layer stack of Modis EVI images with one layer for each 16 day chunk the year.

The positions in the cube (dates) or each downward vector (values for one point on the earth through time) between which I need to sum the values differ for each location.

I have two separate files with start and end point for each downward vector between which i wish to sum the values.

I am unsure of how to go about this. Do I loop through each pixel individualy becuse the vectors are all of different lengths or is there a way to get R to consider the entire array with different start and end positions for summing the values all at once?

sorry if I have been unclear, I am new to this.

Patrick

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 04 Mar 2008 - 08:25:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 04 Mar 2008 - 08:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive