Komine,

Perhaps you want to round to fewer decimals like in:

XY <- round(XY, 4)

You can also define the appropriate RasterLayer r and then use
cellFromXY(r, XY) and use the cell numbers.

Robert

On Mon, Jan 9, 2012 at 12:17 PM, Komine <momadou@yahoo.fr> wrote:

> Hi,
> I have in a matrix 1 255 153 rows and corresponding to the coordinates of
> burned pixels on 10 years. The coordinates are in UTM. I want to know the
> pixels burned several times on the 10 years. However, less 1% of my pixels
> were burned on the 10 years. It seems false. My code uses the center of
> pixels, in this case, a same area can burn several times in the 10 years,
> but because the center of pixels differ little one year to another, the
> code
> will not show correctly me the pixels which burn each year. Because the
> code
> required that the pixels have EXACTELY the same cordinates.
> Do you known a solution with R to resolve this problem?
> My Code:
>
> >redon<-read.table("C:\\Users\\Documents\\\\PixelFire.txt",sep="",dec=",",header=TRUE)
> >XY <- redon[c("X", "Y")]
> >Z<-xtabs(~apply(XY,1,paste,collapse="-"))
> >Z2<-matrix(unlist(strsplit(names(Z),"-")),ncol=2,byrow=T)
> >Matrice<-data.frame(Z2,freq=Z[])
> >write.table(Matrice,"C:\\Users\\Desktop\\Matrice.txt",sep=" ")
>
> Sorry for my bad English!
> Thank you in advance
>
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/redundancy-of-coordinates-of-pixels-tp7169408p7169408.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

