0

I am unfortunately working with R for the first time and I am having a problem with the package "edgar".

My code is as follows: Normal:

MgmtDisc <- getMgmtDisc(cik.no = c(1390777, 1077771, 70858, 1409775, 821127,
                        1049782),
                        filing.year = c(2016, 2017, 2018))

or

With a loop:

cik_vector <- c(1390777, 1077771, 70858, 1409775, 821127, 1049782)
years <- c(2016, 2017, 2018)

for (i in seq_along(cik_vector)) {
  for (j in seq_along(years)) {
  print(i)
  MgmtDisc <- getMgmtDisc(cik.no = cik_vector[i],
                        filing.year = years[i])
}}

I am trying to pull the 10-K filings from the SEC via the edgar package. More specifically, I would like to get the Management Discussion and the Business Describtion. So on the one hand I use the formula getMgmtDisc and getBusinDescr. However, for both of them I have two problems.

  1. sometimes the code works and I get the full filings, but sometimes I don't get anything at all, even though I haven't changed anything in the code and just restarted R or similar.

In this case I get the following error message:

No filing information found for given CIK(s) and Form Type in the mentioned year(s)/quarter(s).
No annual statements found for given CIK(s) and year(s).

Although I know this is not true.

  1. if the code for the filings worked then, but sometimes/most of the time I still don't get the management discussion or the business description. Sometimes only for certain years, even though I know they exist for all years. It just changes very randomly.

In this case, the following error message appears:

Error in getMgmtDisc(cik.no = cik_vector[i], filing.year = years[i]) : 
  object 'words.count' not found

I have tried it with a normal code as well as with a loop. (By the way, is the loop correct?).

Thank you so much for your help!!

4

0 回答 0