I want to read csv files and then append the column names in each object based on the filename as follows:
for (fname in c("abc", "def", "ghi")) {
assign(fname, read.csv(paste(HOMEDIR, fname, pnl.csv, sep="/")))
names(?) = paste(names(?), fname, sep="."))
}
I am facing issues in the renaming part. What should replace ?
?
I have tried get(fname)
, as.name(fname)
, as.symbol(fname)
, etc.