Skip to Content
RStudio for R Statistical Computing Cookbook
book

RStudio for R Statistical Computing Cookbook

by Andrea Cirillo
April 2016
Beginner to intermediate content levelBeginner to intermediate
246 pages
5h 20m
English
Packt Publishing
Content preview from RStudio for R Statistical Computing Cookbook

Tracking stock movements using the quantmod package

An affordable and time-saving way to download and store stock prices can be considered a prerequisite for every future analysis on financial portfolio data.

The quantmod package offers R users a really convenient way to perform this task. Complete documentation for the package is available at http://www.quantmod.com.

Quantmod, through the getSymbols() function, lets you establish a direct connection with financial data sources such as:

  • Yahoo Finance
  • Google Finance
  • www.oanda.com
  • Federal Reserve economic data

This recipe will leverage the getSymbols() function to download Apple's stock quotations. A proper candle and bar chart will then be produced.

Getting ready

As you would expect, we first need to install ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Data Analysis Using Jupyter Notebook

Practical Data Analysis Using Jupyter Notebook

Marc Wintjen

Publisher Resources

ISBN: 9781784391034Supplemental Content