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
{{ message }}
Repository navigation
Provide user-friendly way of loading/attaching the hySpc.* packages #218
I.e., a function that attaches (amost) all installed packages of the hySpc.* family.
Exceptions would be
hySpc.testthat which IMHO shoud not be attached automatically (the more so as testthat masks some
Should hySpc.dplyr be an exception as well? It masks e.g. stats::filter() with totally different functionality.
(but then filter() is always a particularly troublesome function, since there's also signal::filter())?
1. I recommend following the **tidyverse** style code and use all lower case letters in **function** names.
2. I'd prefer the word `load` over `attach`. Yet `attach` would be a more precise term (as packages are loaded and attached).
3. I think it's better to have several functions of this type. Related to this functionality and they should have the common prefix `hyspc_`, e.g (just ideas to illustrate my point):
* `hyspc_load_all()` or `hyspc_attach_all()`
* `hyspc_load_main()`
* `hyspc_load_manipulation()`
* `hyspc_load_tidyverse()` (ggplot + dplyr)
* `hyspc_load_read()`
* `hyspc_packages()`
* `hyspc_update()`
* `hyspc_generate_installation_code()`
Even if we decide to have only a single function, I'd prefer `hyspc_load()` over `load_hyspc()` or `hyspc_attach()` over `attach_hyspc()`
IMHO it would be very confusing if users replace library(hySpc.something) with uppercase S by lowercase hyspc_load(). I vote for hySpc always having the exactly same spelling.
I don't have a strong preference wrt. attach vs. load. I'd prefer attach_hySpc() over hySpc_attach() since I was told that one recommendation in technical writing is to start with the most precise verb one can come up with - so I try to apply this also to variable names.
Further opinions?
I'd prefer to supply one function for attaching/loading, but I'm fine with parameters to switch on/off certain "types" of packages. Easiest would we hySpc.read.anything, since that can be done by a pattern on the package name.
Wrt. further groups of packages such as tidyverse: maintaining lists of package names here is fragile and causes ongoing work: we'd need to maintain this function whenever a new hySpc package appears. Instead, I suggest that we either
add a further group to our package name scheme (e.g. hySpc.dplyr -> hySpc.tidyverse.dplyr or hySpc.tidy.dplyr, hySpc.manip.matrixStats)
or not provide such a granularity in load/attach helper functions.
As for installation and update helpers, @GegznaV please open separate issues for them.
On attach vs load: The typical end user doesn't have much experience with attach, they may have seen load but really they just use library and don't worry about what's going on in the background. I wish to make a plea for the novice end user: Just let them use library("xyz") several times if needed. I know someone argued against this (can't recall who, where) but it's really not that hard to put in a script, and the user and anyone else coming along later has a clear understanding of what was loaded and presumably why.
I've argued this before elsewhere: I thought a major goal of the summer work was to make hyperSpec easier to maintain and simplify things. In particular, break things out into sub-packages so that user could install and load just what they need. Now we seem to be doing the opposite: encouraging users to load them all. True, I'm mixing the steps here a bit, the argument seems to be attach anything already installed, not install everything. Still, just use library several times.
My preference would be to close this issue w/o action or at least put on hold. This issue seems to escalating in complexity with little practical gain. We have other more pressing issues.
IMHO it would be very confusing if users replace library(hySpc.something) with uppercase S by lowercase hyspc_load(). I vote for hySpc always having the exactly same spelling.
I have 2 main preferences (goals) in choosing function names:
consistency in naming strategy,
function names contain only lower-case letters, digits, and underscores (complies with the Tidyverse style). Except for the cases where methods for generics from other packages are created (e.g., for as.data.frame).
To achieve consistency, upper-case letters in the new package names (hySpc.*) from time to time require function names in these packages to have upper-case letters. So at least one of the above-mentioned principles should be violated. As a consequence, I'd still prefer to rename the packages to have only lower-case letters only (maybe, with the exception to hySpc.testthat, as it's already on CRAN). In this way, there would be no conflict in naming conventions.
About the other raised points, I agree with @bryanhanson that we should not discuss them now. It would be better to do that after all the packages planned for the summer school are implemented.
Activity
Implement function to attach/load all hySpc.* packages
cbeleites commentedon Jul 19, 2020
@GegznaV (in the discussion of PR #219)
IMHO it would be very confusing if users replace
library(hySpc.something)with uppercase S by lowercasehyspc_load(). I vote forhySpcalways having the exactly same spelling.I don't have a strong preference wrt. attach vs. load. I'd prefer
attach_hySpc()overhySpc_attach()since I was told that one recommendation in technical writing is to start with the most precise verb one can come up with - so I try to apply this also to variable names.Further opinions?
I'd prefer to supply one function for attaching/loading, but I'm fine with parameters to switch on/off certain "types" of packages. Easiest would we hySpc.read.anything, since that can be done by a pattern on the package name.
Wrt. further groups of packages such as tidyverse: maintaining lists of package names here is fragile and causes ongoing work: we'd need to maintain this function whenever a new hySpc package appears. Instead, I suggest that we either
As for installation and update helpers, @GegznaV please open separate issues for them.
bryanhanson commentedon Jul 19, 2020
On
attachvsload: The typical end user doesn't have much experience withattach, they may have seenloadbut really they just uselibraryand don't worry about what's going on in the background. I wish to make a plea for the novice end user: Just let them uselibrary("xyz")several times if needed. I know someone argued against this (can't recall who, where) but it's really not that hard to put in a script, and the user and anyone else coming along later has a clear understanding of what was loaded and presumably why.I've argued this before elsewhere: I thought a major goal of the summer work was to make
hyperSpeceasier to maintain and simplify things. In particular, break things out into sub-packages so that user could install and load just what they need. Now we seem to be doing the opposite: encouraging users to load them all. True, I'm mixing the steps here a bit, the argument seems to be attach anything already installed, not install everything. Still, just uselibraryseveral times.My preference would be to close this issue w/o action or at least put on hold. This issue seems to escalating in complexity with little practical gain. We have other more pressing issues.
cbeleites commentedon Jul 19, 2020
very good points, @bryanhanson
GegznaV commentedon Jul 20, 2020
I have 2 main preferences (goals) in choosing function names:
as.data.frame).To achieve consistency, upper-case letters in the new package names (hySpc.*) from time to time require function names in these packages to have upper-case letters. So at least one of the above-mentioned principles should be violated. As a consequence, I'd still prefer to rename the packages to have only lower-case letters only (maybe, with the exception to hySpc.testthat, as it's already on CRAN). In this way, there would be no conflict in naming conventions.
About the other raised points, I agree with @bryanhanson that we should not discuss them now. It would be better to do that after all the packages planned for the summer school are implemented.
cbeleites commentedon Jul 24, 2020
We decided in the video call that
bryanhanson commentedon Jul 24, 2020
I made a note in Trello as well.