Comments (4)
the two parameter option sounds good
from taxa.
Thinking about this more, the character input (value = "name"
) should also be accepted, since this is useful for when you have to loop over multiple columns rather than refer to them by name or want to use column index. If its too hard to make it accept both types, then perhaps a new option called exp
could be added and either value
or exp
can be used, but not both.
ex_taxmap$obs("info", exp = sample_1 + sample_2) # OK
ex_taxmap$obs("info", value = "sample_1") # OK
ex_taxmap$obs("info", value = 3) # OK
ex_taxmap$obs("info", value = "sample_1", exp = sample_1 + sample_2) # ERROR
What do you think about having two options for this @sckott? It will be much easier to program than one that accepts both and probably less error prone.
from taxa.
hmm, the way i've seen it done and I've done it as well in some pkgs, is to have two fxns, one like foo
and another foo_
- where foo()
can do e.g. foo(x = bar)
and the other does foo_(x = "bar")
- and foo_
is called from within foo
- or maybe it's better to have parameters as you say above
from taxa.
Oh yea, dplyr
does that, although I think that was removed in the latest version? I did not think of doing that. Something to consider. I never got the hang of using the two function setup myself.
I hesitate to do that because, I already have the functions like filter_taxa
accepts both NSE and SE in the same option, so for consistency, those would perhaps have to be changed to have a filter_taxa_
version. The reason I cannot apply the same logic here is because the value
and proposed exp
options expect different input. The filter for filter_taxa
, is like exp
: it just evaluates an expression, with preference to using variables from all_names()
over those in global; whatever it evaluates to (ids, indexes, T/F) is what is used to filter. value
is expecting a data set name from all_names()
. If they was one option in two functions (NSE/SE), the NSE of value
would be refer to the contents of a column where the SE value
would refer to column names. I find this confusing, and I am not sure where would fit inputing an external variable using SE. Also, I am thinking about letting the subset
option use NSE like filter_taxa
; what if a user wanted NSE for subset
, but not for value
or visa versa?
Are you ok with the two-option setup? That seems the most flexible to me.
from taxa.
Related Issues (20)
- taxonomy_table function issue with add_id_column parameter. HOT 1
- Support matrix data type in parsers and subsetting functions
- news HOT 1
- Print method idea: tidy lists
- Is a `head` function needed for `taxmap`? HOT 2
- `taxa`: way to do operations on objects within it HOT 4
- Vectorizing some classes and reorganizing inheritance hierarchy HOT 49
- possible to put taxize in Suggests? HOT 2
- Assign taxon_rank based on n_supertaxa HOT 1
- Function to produce html/latex table of taxonomic and associated data ? HOT 3
- use cases section a bit outdated HOT 4
- HTTP errors when parsing long taxon_id list HOT 12
- No taxon_rank information when parsing from NCBI taxonomy HOT 1
- import of taxdump files HOT 3
- Error: Failed to install 'taxa' from GitHub HOT 1
- error in db_ref$get() after using $set() HOT 2
- creating a taxonomy database for PR2 HOT 10
- Error when using parse_tax_data function HOT 1
- Issues with CRAN check on 2022-03-10 HOT 1
- vctrs revdep issues HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from taxa.