Skip to content

getBusinDescr() issue with tie in maximum word count #9

@matthewgson

Description

@matthewgson
getBusinDescr(cik.no = 'ALL', filing.year = 1996)
Error in if ((!is.na(product.descr)) & (max(words.count) > 100)) { : 
  the condition has length > 1

Intended is scalar output by choosing word count being maximum:

product.descr <- product.descr[which(words.count == max(words.count))]

However above results in a vector output if there's a tie in maximum word count.
Perhaps using the below would solve the issue? I can PR if it seems fine. Thank you.

if (length(product.descr) > 1) { product.descr <- product.descr[which.max(words.count)] }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions