У меня есть список POLYGON
, и я хотел бы создать тиббл с одним многоугольником столбца geomtry.
my_list <- list(structure(list(structure(list(structure(c(1046881.53939377,
1049327.5242989, 1049327.5242989, 1046881.53939377, 1046881.53939377,
5704036.79875299, 5704036.79875299, 5706482.78365812, 5706482.78365812,
5704036.79875299), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
"sfg"))), class = c("sfc_POLYGON", "sfc"), precision = 0, bbox = structure(c(xmin = 1046881.53939377,
ymin = 5704036.79875299, xmax = 1049327.5242989, ymax = 5706482.78365812
), class = "bbox"), crs = structure(list(epsg = 3857L, proj4string = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"), class = "crs"), n_empty = 0L),
structure(list(structure(list(structure(c(1044435.55448865,
1046881.53939377, 1046881.53939377, 1044435.55448865, 1044435.55448865,
5706482.78365812, 5706482.78365812, 5708928.76856324, 5708928.76856324,
5706482.78365812), .Dim = c(5L, 2L))), class = c("XY", "POLYGON",
"sfg"))), class = c("sfc_POLYGON", "sfc"), precision = 0, bbox = structure(c(xmin = 1044435.55448865,
ymin = 5706482.78365812, xmax = 1046881.53939377, ymax = 5708928.76856324
), class = "bbox"), crs = structure(list(epsg = 3857L, proj4string = "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"), class = "crs"), n_empty = 0L))
Я попытался
tibble(result = do.call(rbind, muylist[1:2]))
# A tibble: 2 x 1
result[,1]
<list>
1 <XY>
2 <XY>
Я хотел бы :
result[,1]
<list>
1 <POLYGON [m]>
2 <POLYGON [m]>