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

Make obs have the option to return data instead of indexes #45

Closed
zachary-foster opened this issue May 13, 2017 · 0 comments
Closed

Make obs have the option to return data instead of indexes #45

zachary-foster opened this issue May 13, 2017 · 0 comments

Comments

@zachary-foster
Copy link
Collaborator

Currently, obs just returns indexes of observations for each taxon. Most of the time that is used to look up some set of values for each taxon, so it would be nice if obs could return that directly.

What had to be done this way:

vapply(obs(data, "my_table"), # For each taxon...
         function(index) sum(data$obs_data[index, id]), numeric(1)) # sum the proportions

Could be done this way:

vapply(obs(data, "my_table", data_col = id), sum, numeric(1)) 
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

1 participant