O'Reilly logo

R Data Analysis Cookbook - Second Edition by Kuntal Ganguly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

Here is how we go about exploring the finance datasets:

  1. Read the finance datasets .csv files. Also check the structure and first 5 rows of the datasets :
> AMZN=read.csv("AMZN.csv",stringsAsFactors = FALSE)> str(AMZN)'data.frame': 2518 obs. of 7 variables: $ Date : chr "2007-08-16" "2007-08-17" "2007-08-20" "2007-08-21" ... $ Open : num 72 74.5 75 74.2 78.2 ... $ High : num 73.2 75 75.3 77.8 79.5 ... $ Low : num 70.1 73.1 73.8 74.1 77.8 ... $ Close : num 72.8 75 74.7 77.5 78.5 ... $ Adj.Close: num 72.8 75 74.7 77.5 78.5 ... $ Volume : int 10787300 7240600 5916100 8429100 6848100 5665000 5665700 6951300 5767000 5076800 ...> GOOG=read.csv("GOOG.csv",stringsAsFactors = FALSE)> head(GOOG, 5)

The first 5 rows of the google finance ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required