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
Currently the data frame that is passed to usmap_transform must have longitude in the first column and latitude in the second column. It might be more natural to allow columns in any order that have the names lon/long/longitude and lat/latitude.
There can also be two optional parameters to specify the longitude/latitude column names.
For example:
If a data.frame contains columns "x" and "y" instead, usmap_transform(data, longitude_name = "x", latitude_name = "y")
Improve data output
Currently the output data frame contains 4 columns: the two input columns followed by the two output columns. The output columns have the same name as the input columns but with a .1 appended to the end. This does not allow for intuitive use of the function as someone would have to inspect and notice the differences manually.
It might be better include an optional parameter that allows replacement of the input columns (i.e. input data frame has 2 columns named "lon" and "lat", and the output data frame has the same 2 columns, with data transformed). If all 4 columns are to be included in the output, a better convention might be to append _tf or prefix transformed_, etc. (TBD)
Decided to default to output columns of x and y, as well as adding a parameter titled output_names that accepts a character vector of length two which specify what the columns should be named. Also added an input_names parameter which defaults to lon/lat to specify the longitude and latitude columns from the input data.
Improve data input flexibility
Currently the data frame that is passed to
usmap_transform
must have longitude in the first column and latitude in the second column. It might be more natural to allow columns in any order that have the nameslon
/long
/longitude
andlat
/latitude
.There can also be two optional parameters to specify the longitude/latitude column names.
For example:
If a data.frame contains columns "x" and "y" instead,
usmap_transform(data, longitude_name = "x", latitude_name = "y")
Improve data output
Currently the output data frame contains 4 columns: the two input columns followed by the two output columns. The output columns have the same name as the input columns but with a
.1
appended to the end. This does not allow for intuitive use of the function as someone would have to inspect and notice the differences manually.It might be better include an optional parameter that allows replacement of the input columns (i.e. input data frame has 2 columns named "lon" and "lat", and the output data frame has the same 2 columns, with data transformed). If all 4 columns are to be included in the output, a better convention might be to append
_tf
or prefixtransformed_
, etc. (TBD)Other Fixes
The text was updated successfully, but these errors were encountered: