Hello,
I have a 3D array with an attribute converted to SpatiaGridDataFrame named
?clip? :
Object of class SpatialGridDataFrame
Coordinates:
min max
s1 828104.00 828134.00
s2 101839.00 101869.00
s3 324.09 373.09
Is projected: TRUE
proj4string :
[+init=epsg:27561 +proj=lcc +lat_1=49.50000000000001
+lat_0=49.50000000000001 +lon_0=0
+k_0=0.999877341 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515
+towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs]
Grid attributes:
cellcentre.offset cellsize cells.dim
s1 828104.50 1 30
s2 101839.50 1 30
s3 324.59 1 49
Data attributes:
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.000 0.000 0.000 0.002 0.000 0.806 9506.000
The apply() function does not work on the 3rd dimension of the
SpatiaGridDataFrame :
D.tls.z.mean <- apply(clip, 3, mean, na.rm=T)
=> I get an error message (sorry it's in French) :
"Erreur dans if (d2 == 0L) { : valeur manquante l? o? TRUE / FALSE est
requis"
I tried with z coordinate instead :
z <- coordinates(clip)[,3]
D.tls.z.mean <- apply(clip, z, mean, na.rm=T)
The only solution I found is to convert back to standard non spatial 3D
array.
Cheers,
Nathalie MORIN
Doctorante en t?l?d?tection foresti?re (Ph.D student in remote sensing
applied to forestry)
Centre d?application et de recherches en t?l?d?tection (CARTEL)
D?partement de G?omatique Appliqu?e
Sherbrooke (QC) CANADA J1K 2R1
T?l. : + 1 (819) 821-8000 #62962
e-mail : <mailto:Nathalie.M.Morin at Usherbrooke.ca>
Nathalie.M.Morin at Usherbrooke.ca
<http://www.usherbrooke.ca/> Universit? de Sherbrooke