Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8470425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:30:54+00:00 2026-06-10T16:30:54+00:00

I am trying to load multiple symbols using a csv file rather than downloading

  • 0

I am trying to load multiple symbols using a csv file rather than downloading from Yahoo. The original code works great and uses

load.packages('quantmod')
tickers = spl('TLT,IWM,GLD')
data <- new.env()
getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env = data,
           auto.assign = T)

when I try using the code below, however, it results in “subscript out of bounds” errors later in the script:

load.packages('quantmod')
tickers = spl('TLT,IWM,GLD')
data <- new.env()
getSymbols(tickers, src="csv", dir= "C:/Users/Admiral/Downloads/",
           env = data, auto.assign = T)

Anyone have thoughts why the second code set wont work? To test I’ve just downloaded csv data from Yahoo and saved locally (windows). I dont get the subscript errors if I just use one csv file. I’ve also tried the code below but get the same errors later in the script:

setSymbolLookup(tickers=list(src="csv", dir= "C:/Users/Admiral/Downloads/"))
getSymbols(tickers, auto.assign = T, from = '1980-01-01', env=data)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:30:55+00:00Added an answer on June 10, 2026 at 4:30 pm

    I would do this using the FinancialInstrument package

    require('quantmod')
    require('FinancialInstrument')
    tickers <- c("TLT", "IWM", "GLD")
    data <- new.env()
    getSymbols(tickers, src = 'yahoo', from = '1980-01-01', env = data)
    
    # Now save the data in a directory
    tmpdir <- tempdir()
    saveSymbols.common(tickers, tmpdir, env=data)
    
    #remove the data    
    rm(list=tickers, pos=data)
    ls(data) # see that there is nothing there
    # Now load the data back from disk
    getSymbols(tickers, src='FI', dir=tmpdir, env=data, split_method='common')
    ls(data)
    

    If you want to use getSymbols.csv, your data has must have the Date and 6 columns (OHLCVA)

    #write data to csv files on disk
    for (i in seq_along(tickers)) {      
      write.zoo(get(tickers[i], pos=data), file=paste0(tmpdir, "/", tickers[i], ".csv"), sep=",")
    }
    rm(list=tickers, pos=data) #remove from memory
    getSymbols(tickers, src='csv', dir=tmpdir)#, env=data)  #load from csv files
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to load multiple files using HTML5. This is my code I
I am trying to load multiple elements with the same name from XML into
i m trying load UIImages from server asynchronously in UITableViewCell. My code worked fine
I am trying to load multiple images onto a canvas using html5 img tag.
I'm trying to test a SOCKS proxy that's under load from multiple machines. The
Need to load data from a single file with a 100,000+ records into multiple
Need to load data from a single file with a 100,000+ records into multiple
I'm trying to combine multiple js file references using Telerik's script manager. Here is
I am trying to load a flat file which mixed multiple data sets. The
I'm trying to load different data, from different files, into multiple columns in MySQL.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.