Hi, thanks for the help  R-sig-Geo-users. 

Gaspar Reyes Póndigo
Universidad del Mar, Oaxaca, México
Campus Puerto-Ángel
Carretera principal Puerto Ángel Zipolite km 1.5 
C.P. 70902

El 22/08/2011, a las 02:41, ahmadou dicko escribió:

> HI Gaspar,
> 
> The ATC.ms.values is not a SpatialGridDataFrame so there is not a "DATA SLOT" in this object. The wiki page you used is old (R 2.7) and the there's a typo. 
> So in your case, instead of
> 
> ATC.ms.nonas <- ATC.ms.values@data[ATC.ms.
> values, ]
> 
> 
> use
> 
> ATC.ms.nonas <- ATC@data[ATC.ms.
> values, ]
> 

I used this suggestion to solve my problem, thanks ahmadou

> but as they pointed out on that page you can simply do
> 
> ATC.ms.values <- complete.cases(ATC@data)
> 
> ATC.ms.nonas <- ATC@data[ATC.ms.values,  ]
> 
> 
> Also for numerical stability prcomp is  better (and probably faster) than princomp.
> 
> 
> 2011/8/22 Gaspar Reyes Póndigo <gos47@hotmail.com>
> Hi, Dear R-SIG-GEO User
> 
> I am new user R 2.13 (spgrass6) from GRASS-GIS 6.4.1-5, under Mac OS X 10.68. I have the following problem, when preparing the data before run R's princomp() function in R from GRASS,  there was an error. The line of code is copied below:
> 
> 
> #########################################
> library(spgrass6)
> 
> G <- gmeta6()
> 
> ATC <- readRAST6(c('Acrf_1993_b1','Acrf_1993_b2','Acrf_1993_b3','Acrf_1993_b4','Acrf_1993_b5','Acrf_1993_b7'))
> 
> ATC.nas <- which(is.na(ATC@data$Acrf_1993_b1) & is.na(ATC@data$Acrf_1993_b2) & is.na(ATC@data$Acrf_1993_b3) & is.na(ATC@data$Acrf_1993_b4) & is.na(ATC@data$Acrf_1993_b5) & is.na(ATC@data$Acrf_1993_b7))
> 
> ATC.ms.values <- which(!is.na(ATC@data$Acrf_1993_b1) & !is.na(ATC@data$Acrf_1993_b2) & !is.na(ATC@data$Acrf_1993_b3) & !is.na(ATC@data$Acrf_1993_b4) & !is.na(ATC@data$Acrf_1993_b5) & !is.na(ATC@data$Acrf_1993_b7))
> 
> #######################################
> ####  I got the following error message
> #######################################
> ATC.ms.nonas <- ATC.ms.values@data[ATC.ms.values, ]
> Error: tentativa de obtener un slot "data" de un objeto de una clase básica ("integer") sin slots
> #########################################
> 
> Can you please point my problem? and How do I fix my problem?
> Thanks in advance for any help.
> 
> NOTE:I followed the guide of http://grass.osgeo.org/wiki/Principal_Components_Analysis # Using_R.27s_princomp.28.29_function for  PRINCOMP() function.
> NOTE: the images are LANDSAT 5 TM
> 
> 
> Gaspar Reyes Póndigo
> Universidad del Mar, Oaxaca, México
> Campus Puerto-Ángel
> Carretera principal Puerto Ángel Zipolite km 1.5
> C.P. 70902
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 


	[[alternative HTML version deleted]]

