ropensci / taxa

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

Speed up `parse_tax_data` #177

Closed zachary-foster closed 5 years ago

zachary-foster commented 5 years ago

Most of the time is spent here:

  # Create taxmap object
  hier_objs <- lapply(parsed_tax, function(x) {
    output <- hierarchy()
    output$taxa <- lapply(seq_len(length(x)), function(i) {
      taxon(x[i], rank = names(x[i]))
    })
    return(output)
  })
  output <- taxmap(.list = hier_objs)

creating hierarchy objects that are only intermediates. It can be refactored to not use hierarchy objects.