LoslegenKostenlos starten

Import well-formatted daily OHLC data

You can use getSymbols() to import a well-formatted CSV. In this case, well-formatted means the file contains data for a single instrument with date, open, high, low, close, volume, and adjusted close columns, in that order. You might have noticed that this is the same format as getSymbols() returns when you download data from internet sources.

getSymbols() allows you to use a directory of CSV files as a source (like Yahoo Finance and FRED). In this exercise, you will be using AMZN.csv in your working directory. It contains some randomized Amazon.com data from the first half of 2002. You can use dir() to see the file in your working directory.

Diese Übung ist Teil des Kurses

<Kurs>Importing and Managing Financial Data in R</Kurs>
Kurs ansehen

Übungsanweisungen

  • Use getSymbols() to load AMZN.csv.
  • Look at the structure of AMZN.

Interaktive praktische Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Load AMZN sourced from the csv
getSymbols("___", src = "___")

# Look at AMZN structure
Code bearbeiten und ausführen