britishredcrosssociety / local-lockdown

R Shiny dashboard for visualising information related to Covid-19 Test & Trace and local lockdowns
Other
1 stars 1 forks source link

Car Park Locations #37

Open MikeJohnPage opened 4 years ago

MikeJohnPage commented 4 years ago

I am unable to replicate the script to generate car park locations. I've tracked the bug down to line 141. The issue comes in trying to turn an object of class sgbp into a tibble. In this instance the sgbp object is a spare matrix represented as a list. as_tibble fails because it is trying to generate columns off lists of unequal lengths.

One solution may be to first transform the object to a data.frame, and then to a tibble(as as.data.frame recycles lists of unequal lengths):

curr_msoas %>%
    st_touches() %>% 
    as.data.frame() %>%
    as_tibble()  %>% 
    unique()

See here for more info on sgbp objects.