Quantcast
Channel: I have R code to extract information from one document. How do I loop that for all the documents in my folder? - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by Gregor Thomas for I have R code to extract information from one...

Put your code in a function:extract_info = function(file) { ## Add the code you need to read the text from the file ## Something like ## text <- readLines(file) ## or whatever you are using to read...

View Article



Answer by DataM for I have R code to extract information from one document....

I'm not using a loop but using lapply and a function has the same behavior of a loop :my_path <- "C:/Users/SAID ABIDI/Desktop/test/"my_a <- list.files(path = my_path)my_function <- function(x)...

View Article

I have R code to extract information from one document. How do I loop that...

I have a folder of txt files, and I want to extract specific texts from them and arrange them separate columns into a new data frame. I did the code for one file, but I can't seem to edit it into a...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images