Based on the data you provided, your final SPDF would have two polygons?
Assuming that's correct, I would go about it like this:

mydata <-
data.frame(Id=c("09G001_Plot513","09G001_Plot513","09G001_Plot513","09G001_Plot513",
"09G001_Plot513","09G001_Plot519","09G001_Plot519","09G001_Plot519","09G001_Plot519",
"09G001_Plot519"),X=c(750631.2,750634.8,750644.2,750640.6,750631.2,750921.3,750923.4,750933.2,750931.1,750921.3),
Y=c(7250205,7250214,7250211,7250201,7250205,7250200,7250209,7250207,7250198,7250200))

mydata2 <- split(mydata, mydata$Id)

gi1 <- Polygons(list(Polygon(mydata2[[1]][2:3])), ID = mydata2[[1]][1,1])
gi2 <- Polygons(list(Polygon(mydata2[[2]][2:3])), ID = mydata2[[2]][1,1])

gi <- SpatialPolygons(list(gi1, gi2))

fakedata <- data.frame(precipitation = runif(2), maxtemp = c(4, 11), pH =
c(3, 8))
row.names(fakedata) <- unique(mydata$Id)

out <- SpatialPolygonsDataFrame(Sr = gi, data = fakedata)


Cheers,
Roman



On Wed, Apr 27, 2011 at 8:50 PM, gianni lavaredo
<gianni.lavaredo@gmail.com>wrote:

> dear reseachers,
>
> I wish to understand I can convert a data.frame in a
> SpatialPolygonDataframe
> without using "convert.to.shapefile" of shapefiles library
>
> thanks in Advance
> Gianni
>
> mydata <-
>
> data.frame(Id=c("09G001_Plot513","09G001_Plot513","09G001_Plot513","09G001_Plot513",
>
> "09G001_Plot513","09G001_Plot519","09G001_Plot519","09G001_Plot519","09G001_Plot519",
>
> "09G001_Plot519"),X=c(750631.2,750634.8,750644.2,750640.6,750631.2,750921.3,750923.4,750933.2,750931.1,750921.3),
>
>
> Y=c(7250205,7250214,7250211,7250201,7250205,7250200,7250209,7250207,7250198,7250200))
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
In God we trust, all others bring data.

	[[alternative HTML version deleted]]

