Open zachary-foster opened 6 years ago
This will often happen when making new tables from the output of functions that return per-taxon values, such as obs_apply, supertaxa, subtaxa, subtaxa_apply, etc.
obs_apply
supertaxa
subtaxa
subtaxa_apply
For example, instead of:
obj <- mutate_obs(obj, "per_taxon", taxon_id = taxon_ids, mean_pid = unlist(obs_apply(obj, "query_data", mean, value = "pid")), n_otus = unlist(obs_apply(obj, "query_data", value = "query", func = function(x) length(unique(x)))))
This would do the same:
obj <- mutate_obs(obj, "per_taxon", mean_pid = unlist(obs_apply(obj, "query_data", mean, value = "pid")), n_otus = unlist(obs_apply(obj, "query_data", value = "query", func = function(x) length(unique(x)))))
since the output of unlist(obs_apply(....)) will be named by taxon IDs.
unlist(obs_apply(....))
The taxon_id column would only be added if names of input vectors match and are all valid taxon IDs.
This will often happen when making new tables from the output of functions that return per-taxon values, such as
obs_apply
,supertaxa
,subtaxa
,subtaxa_apply
, etc.For example, instead of:
This would do the same:
since the output of
unlist(obs_apply(....))
will be named by taxon IDs.The taxon_id column would only be added if names of input vectors match and are all valid taxon IDs.