You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got this kind of thing in dodgr with an internal dodgr_graph_cols function, which relies on a whole bunch of helper functions here. It's kinda messy, but works really well at auto-identifying standard columns based on unknown and variable input names. The idea is to return a list so everything else then works like this:
... or whatever. Point is, it's robust and flexible: Write a function to auto-identify the columns you need; return those as list items; then use code like the above to extract when needed.
yeah, the details are all pretty easy. The difficult and important thing was figuring out that the get_columns function should return a list. From that point on, it's all easy
At the moment
maxcovr
assumes that all columns with latitude and longitude information are namedlat
andlong
.This is not ideal, as it throws a cryptic error message when these are not given the appropriate names.
There should be three steps in refactoring:
Add a
stop
function that stops the analysis if things are not namedlat
andlong
. This can then be used in each function that uses that info.Allow the user to specify their own
lat
andlong
argumentsCleverly detect different variations on
lat
andlong
asleaflet
does and display a nice messageThe text was updated successfully, but these errors were encountered: