I'm looking to work with the data frames I have within a list. I'm getting 'incorrect number of subscripts' and similar errors, despite my current best efforts. Here's my code:
folder = 'C:/Path to csv files-071813/'
symbs = c('SPX', 'XLF', 'XLY', 'XLV', 'XLI', 'IYZ', 'XLP', 'XLE', 'XLK', 'XLB', 'XLU', 'SHV')
importData = vector('list', length(symbs))
names(importData) = symbs
for (sIdx in 1:length(symbs)){
#Import the data for each symbol into the list.
importData[sIdx] = read.csv(paste(folder, symbs[sIdx], '.csv', sep = ''), header = TRUE)
}
Each csv file is thousands of rows, and 7 columns. I'm assuming what I have above is returning a data frame from each csv file, into my list. I'd like to enter:
importData[[1]][, 1]
to work with the first column of the first data frame in my list. Am I close? I can't find resolution despite all my searching. Many thanks in advance...