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

Add a common prefix to functions? #45

Open
etiennebacher opened this issue Jul 10, 2024 · 2 comments
Open

Add a common prefix to functions? #45

etiennebacher opened this issue Jul 10, 2024 · 2 comments

Comments

@etiennebacher
Copy link

I don't really use this package (I just like following the development of Rust-based packages) so feel free to dismiss this comment, it just came to me when I saw the new geom_line in the NEWS of 0.1.7.

I see that you have some functions that would conflict with ggplot2, e.g. geom_line(), geom_polygon(). I like the API of sf that has all its functions starting with sf_, st_ or gdal_, it makes it easy to discover functions and works well with autocomplete. Maybe you could take advantage of the fact your package is relatively young to add a prefix rsg_ to most functions?

On the other hand, one could say that you could replace the rsg_ prefix by rsgeo::.

@JosiahParry
Copy link
Owner

I agree. There’s even an unexpected namespace collision with ggplot. It should t be a problem except for the fact that ggplot is a bit aggressive with its takeover.

I am opposed to repetitive prefixing for example writing geos::geos_ is redundant. st_ is useful in that it mimics PostGIS and is indicative of a spatial transformation.

I haven’t had time to revisit this R package but it was slated for archival today if I didn’t do anything. If you have any suggestions to improve the naming conventions, please let me know!

At minimum, the Geom struct needs to be renamed.

@etiennebacher
Copy link
Author

st_ is useful in that it mimics PostGIS

I had no clue about that.

I am opposed to repetitive prefixing for example writing geos::geos_ is redundant

True, but having a common prefix would remove the need to write <pkg>::. If you'd rather prefix everything with rsgeo:: then I guess you don't need to rename anything since there won't be collisions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants