I need to read multiple Txt file in R to create a unique dataset and export it on Excel. this is what I used
BHCFYYMM <- read.table('bhcf1803.txt''bhcf1806.txt''bhcf1809.txt''bhcf1812.txt', sep="^", nrows=1300, comment.char="", header=TRUE, quote="", na.strings="--------", as.is=TRUE)
setwd("/Users/marco/Desktop/research/silvio")
getwd()
write.table(BHCFYYMM, file = "HoldingCompanyData.csv", sep = ",")
but i get this error:
Error: unexpected string constant in "BHCFYYMM <- read.table('bhcf1803.txt''bhcf1806.txt'"
Any idea how I can approach this?