Skip to content
Back to formatted view

Raw Message

Message-ID: <1315907509726-6786840.post@n2.nabble.com>
Date: 2011-09-13T09:51:49Z
From: Alfredo Alessandrini
Subject: subs and the name of column
In-Reply-To: <1311043884878-6597311.post@n2.nabble.com>

Hi,

I've tried with the names of the column but don't work:

> data_6SV_cluster
  cluster   intercept coefficient
1       1 -0.04436168    1.286019
2       2 -0.04415990    1.283883
3       3 -0.04414168    1.286019
4       4 -0.04375406    1.280874
5       5 -0.04400495    1.281942
6       6 -0.04390901    1.282816
> as.matrix(raster_cluster)
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    4    5    6
> colnames(data_6SV_cluster)
[1] "cluster"     "intercept"   "coefficient"
> subs(raster_cluster,data_6SV_cluster,which="coefficient")
Error in `[.data.frame`(y, , c(by, which)) : undefined columns selected
> subs(raster_cluster,data_6SV_cluster,which=3)
class       : RasterLayer 
dimensions  : 2, 3, 6  (nrow, ncol, ncell)
resolution  : 0.2678571, 0.2678571  (x, y)
extent      : 99.48661, 100.2902, 2.191965, 2.727679  (xmin, xmax, ymin,
ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs
+towgs84=0,0,0 
values      : in memory
min value   : 1.280874 
max value   : 1.286019 


Thanks,

Alfredo


--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/subs-and-the-name-of-column-tp6594997p6786840.html
Sent from the R-sig-geo mailing list archive at Nabble.com.