Hi,

Your data seems to contain null values, which causes the error.

You should create a raster from non-null values and run the algorithm again.

Best,

Mathieu

2012/1/11 Vikram Ranga <babuawara@gmail.com>

> Hello Everyone,
> I am trying to run k-means algorithm with R on Landsat images but it is
> giving error that the data type is not supported.
> My syntax is
> juneb1<-readGDAL("G:/landsat/**New Landsat/June/2002-06-08/**
> 8juneb10.tif")
> kmenjuneb<-kmeans(juneb1,10,**iter.max = 6, nstart = 1,
>       algorithm = c("Hartigan-Wong", "Lloyd", "Forgy",
>                     "MacQueen"))
> error message
> Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1)
>
> Is there anyother way to do cluster analysis to spatial data in R?
> Any help would be greatly appreciated.
>
>
> Vikram.
>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>

	[[alternative HTML version deleted]]

