Open zachary-foster opened 6 years ago
Will this solution scale ? e.g, if a user has 1000 tables in the object. I guess each table does have to have a unique name, correct?
Will this solution scale ? e.g, if a user has 1000 tables in the object.
I don't think it will be a problem computationally, but it would certainly be confusing.
I guess each table does have to have a unique name, correct?
Ahh yea, I did not think about that. Good point. Yes, each table would need a unique name. If you had many unnamed tables, then NSE would not be a good way to access that data anyway however. The user can always use the data
list directly in that case.
right, so should we enforce unique table names then?
I dont think so, just have NSE only work on named tables and warn the user if they specify something ambiguous and say what is being used. If ambiguous column names are used then I just added the warning:
> x$filter_obs("abund", code == "T")
Warning message:
Ambiguous names used in non-standard evaluation:
code
These could refer to values in different datasets with the same name. The following values will be used:
data$abund$code
We could do something similar for multiple datasets with the same name.
Unnamed datasets perhaps could be referenced by [[3]]$code
, although that is a little cryptic and arbitrary and harder to implement.
I think of NSE as a convenience (it should not be the only way to do any operation), so it does not need to work in all cases as long as it fails with a good warning/error.
Okay, sounds good
This would be a solution to the problem described in #153. Say we have:
Then, in:
count
is ambiguous and would generate a warning (#153) and recommend that the user could specify the dataset like so:For a single operation, this would be equivalent to:
However, when a series of filters is piped together with
%>%
,obj$data$abund$count
might be "outdated" if thetaxmap
in the pipe was changed due to a previous filtering step.Theabund$count
would use the changed version.Seem reasonable @sckott?