Reading multiple files from a directory, R

前端 未结 2 1531
闹比i
闹比i 2021-02-03 16:29

I am having difficulty with one step in my code to read in a folder of text files and convert it to a dtm. The problem is that, for some reason, my computer is only able to int

2条回答
  •  有刺的猬
    2021-02-03 16:34

    List.filesonly gives you the file names, not file names with full path. Try

    files <- as.character(list.files(path="[file path]"))
    readLines(paste("[file path]",.Platform$file.sep,files[1],sep=""))
    

提交回复
热议问题