I am trying to combine multiple NDJSON files into one. The NDJSON file names are "FileName_1", "FileName_2", "FIleName_3", etc. I've tried to build a file list by using list.files, and then use stream_in as a function in lapply like the codes below, but I got the error "invalid 'description' argument". But if I use lapply(list_files, stream_in(file())), then I got the error "'stream_in(file())' is not a function, character or symbol". What should be the best way to combine multiple NDJSON files into one? Thanks.
#>
ABC=list.files(pattern="File_Name_*", full.name=TRUE)
Logs=lapply(list_files, stream_in(file(ABC)))
files = do.call(rbind,Logs)