Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
awallender opened this issue Mar 10, 2023 · 0 comments
Open

Comments

@awallender
Copy link

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant