Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usmap_transform improvements #33

Closed
pdil opened this issue Mar 25, 2020 · 1 comment · Fixed by #53
Closed

usmap_transform improvements #33

pdil opened this issue Mar 25, 2020 · 1 comment · Fixed by #53
Assignees
Labels
enhancement A suggestion or feature that improves existing functionality
Milestone

Comments

@pdil
Copy link
Owner

pdil commented Mar 25, 2020

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 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)

Other Fixes

@pdil pdil added the enhancement A suggestion or feature that improves existing functionality label Mar 25, 2020
@pdil pdil added this to the v0.6.0 milestone Mar 25, 2020
@pdil pdil self-assigned this Mar 25, 2020
@pdil pdil pinned this issue Feb 7, 2022
@pdil
Copy link
Owner Author

pdil commented Feb 24, 2022

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.

@pdil pdil closed this as completed in #53 Feb 24, 2022
@pdil pdil unpinned this issue Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A suggestion or feature that improves existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant