-
Notifications
You must be signed in to change notification settings - Fork 15
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
A convention for functions #24
Comments
ha, I have built an entire internal package for accessing data that I called getdata. Great minds and all that. what about just "get_"? from the options above I think I prefer number 2.
it matches best at least in the seifa case |
Yep, let's run with that for now. And I am fine with More generally in terms of
|
Also, I would suggest:
Should all this be documented in a wiki? @wfmackey |
A wiki is a great idea, @daviddiviny ! It could be a section in the larger 'how to contribute' document #4. |
FYI @daviddiviny I've opened a PR to merge the |
Thinking about this some more recently. The package contains 'families' of functions denoted by their prefix. So far we have:
and then we have structures -- eg Some questions/thoughts are:
|
|
I am open to changing it, not sure if putting it in the |
See: #23 (comment) from @mrjoh3
I think we have to make a decision on a prefix for data retrieval functions from
abscorr
, and develop a convention for what is attached to a function, what is included in an argument, etc.The prefix can some something simple and consistent, maybe
getdata_
.The convention should include standard positions for
<connecting structure>
(eg ASGS SA2) and<data name>
(eg SEIFA scores), and then additional data options, such as<data subclass>
(eg SEIFA IRSAD),<year>
, etc.From that, some options are:
getdata(data = <data name>, structure = <connecting structure>, data_subclass = <data subclass>)
; so:getdata(data = "seifa", structure = "sa2", data_subclass = "irsad")
purrr
family:getdata_<data name>(structure = <connecting structure>, data_subclass = <data subclass>)
; so:getdata_seifa(structure = "sa2", data_subclass = "irsad")
getdata_<connecting structure>_<data name>_(data_subclass = <data subclass>)
; so:getdata_sa2_seifa(data_subclass = "irsad")
Maybe one way to start is to have a
getdata()
master function (option 1), and then build helper functions (2, 3) on top of them (if desirable).The text was updated successfully, but these errors were encountered: