Skip to content

"getHTMLFilings( )" function broken for R versions 4.2.0 or newer #6

@awallender

Description

@awallender

Lines 113-119 in the getFilingsHTML() function utilize an "if" statement that contains a condition with a length greater than 1.

edgar/R/getFilingsHTML.R

Lines 113 to 119 in b2f9b47

if(!grepl(pattern ='<xml>|<type>xml|<html>', filing.text, ignore.case=T)){
filing.text <- gsub("\t"," ", filing.text)
filing.text <- gsub("<CAPTION>|<S>|<C>", "", filing.text, ignore.case = T)
## Append with PRE to keep the text format as it is
filing.text <- c("<PRE style='font-size: 15px'>", filing.text, "</PRE>")
}

As of R 4.2.0, "if" statements with conditions of length greater than one are now an error (rather than a warning). This change in how R treats such "if" statements broke this function and produces the following error message:

Error in if (!grepl(pattern = "<xml>|<type>xml|<html>", filing.text, ignore.case = T)) { :
the condition has length > 1

I am running R version 4.2.2 (2022-10-31 ucrt).

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