I can produce Polygon layer from matrix in following way:
pols <- lapply(cdf, Polygon) pls <- lapply(seq_along(pols), function(i) Polygons(list(pols[[i]]), ID = i)) sps <- SpatialPolygons(pls) sps_df <- SpatialPolygonsDataFrame(sps, data.frame(x = rep(NA, length(pls)), row.names = names(pls)))
cdf is a matrix of points (x, y) for the polygon(s). My question is: how to do the same for points or even circles? I don't have a function to cast like
pols <- lapply(cdf, Point) to produce
SpatialPoints object from many points.