dime-worldbank / big-data-poverty-estimation

Develop machine learning models for poverty estimation
23 stars 6 forks source link

Reproducubility verification (2) #32

Open mariarrt94 opened 7 months ago

mariarrt94 commented 7 months ago

https://github.com/dime-worldbank/big-data-poverty-estimation/blob/5b69a88c6e5bbf8ccdd699d4acd3ffd4623d9f49/DataWork/05_figures_tables_global/main/levels_2_global_scatterplot_average_map.R#L225

after running tidy() I got: Error in is.data.frame(x) : 'list' object cannot be coerced to type 'double'

Error is solved by dropping the geometry. I imagine with tidy you are trying to convert the multipolygon to a non-spatial format, but I am not sure why is not doing it with the SF.

Solved by world_sp_tidy <- st_drop_geometry(world_sp)

ramarty commented 7 months ago

@mariarrt94 See answer to the issue here. I think converting from sf to sp should solve this issue.

Realize sf is now the way to go... but was just using sp methods when making this map