ropensci / taxa

taxonomic classes for R
https://docs.ropensci.org/taxa
Other
48 stars 12 forks source link

Tabular data for `taxonomy` class #105

Closed sckott closed 6 years ago

sckott commented 6 years ago

related to #58

Still would need to do for taxmap but first wanted to get your feedback on this @zachary-foster sine you're i think more familiar with the taxonomy and taxmap classes. Does this change look good? Do you want it set up differently? Different fxn name? Or as a parameter inside of get_data?

## hier1 etc. from `taxonomyegs` file
x <- taxonomy(hier1, hier2, hier3)
x$get_data_frame()
#> # A tibble: 9 x 12
#>           taxon_names taxon_ids taxon_indexes n_supertaxa n_supertaxa_1 n_subtaxa
#> *               <chr>     <chr>         <int>       <dbl>         <dbl>     <dbl>
#> 1            Mammalia         b             1           0             0         8
#> 2        Notoryctidae         c             2           1             1         2
#> 3             Felidae         d             3           1             1         4
#> 4          Notoryctes         e             4           2             1         1
#> 5                Puma         f             5           2             1         1
#> 6            Panthera         g             6           2             1         1
#> 7 Notoryctes typhlops         h             7           3             1         0
#> 8       Puma concolor         i             8           3             1         0
#> 9     Panthera tigris         j             9           3             1         0
#> # ... with 6 more variables: n_subtaxa_1 <dbl>, taxon_ranks <chr>, is_root <lgl>,
#> #   is_stem <lgl>, is_branch <lgl>, is_leaf <lgl>
sckott commented 6 years ago

@zachary-foster build is failing - i'm guessing cause the example object hasn't been refreshed. How do you go about doing that for the taxonomy and taxmap example objects

zachary-foster commented 6 years ago

Looks good at first glance! I have a series of meetings today so I cant look at it in detail until tonight.

How do you go about doing that for the taxonomy and taxmap example objects

Run the code in ?taxmap and devtools::use_data(ex_taxmap, overwrite = TRUE). Same for taxonomy. I wonder if we can automate this every time the package is built or a commit is made?

sckott commented 6 years ago

ok, thanks. That would be cool to automate the example data objects updates. Will open a sep. issue about it so we don't forget

zachary-foster commented 6 years ago

LGTM

sckott commented 6 years ago

i have a bit of fixing to do to this i found out, will push that soon