How to clean local txt files in R?

Make sure you have stringi installed

    # A file on your local system
    path <- system.file("some.txt",  package = "rvest")
    x <- read_html(path)
    clean.txt <- x %>% html_nodes("p") %>% html_text()

When you've finished processing you can write back clean.txt

write(clean.txt, file = "GE1Q19.txt",