I am new to R and would like to have it read all the 10-K financial reports which are in .txt format and I want it to read all these files at once?
I have tried
dir<- "/Users/Documents/Edgar filings"
text = readtext(paste0(dir, "/ALL_2016/*.txt")
However, nothing happens, I mean no output is produced at the console section, and also there is no errors.
I tried to have it read only one 10-K report through
dir <- "/Users/Documents/Edgar filings"
text = readtext(paste0(dir, "/ALL_2016/10254_10-K_2016-03-11*.txt")
but again neither any output nor any error messages.
I tried it through quanteda
mycorpus <- corpus(textfile("~/ALL_10-K_2016/*.txt"))
but this time it says "textfile function is not available for 3.4.3" even though my R version is 3.4.4 which I updated a couple of weeks ago.
I also tried using list.files()
but I do not know how to create a loop coding, so I just got stuck!
I highly appreciate if someone please help.