hypertidy / silicate

A general form for complex data
https://hypertidy.github.io/silicate/
53 stars 4 forks source link

subset bug #119

Closed mdsumner closed 4 years ago

mdsumner commented 4 years ago

When subsetting sf the IDs get screwed up

 get_ids <- function(x) {list(sort(x$object$object_), sort(unique(x$triangle$object_)))}

get_ids(DEL(minimal_mesh))  ## no worries

## SCREWED
get_ids(DEL(minimal_mesh[2:1, ]))  
[[1]]
[1] "I9EmCe" "j9pUsL"

[[2]]
[1] "HJFzNn" "x2Wxrg"

## SCREWED
get_ids(DEL(minimal_mesh[1, ]))  
[[1]]
[1] "vGsllv"

[[2]]
[1] "LiFjI4"
mdsumner commented 4 years ago

PATH problem

 get_ids_path <- function(x) {list(sort(x$object$object_), sort(unique(x$path$object_)))}

library(silicate)
get_ids_path(PATH(minimal_mesh))
get_ids_path(PATH(minimal_mesh[2:1, ]))