library(quantmod)
## Loading required package: xts
## Loading required package: zoo
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric
## Loading required package: TTR
## Version 0.4-0 included new data defaults. See ?getSymbols.
start=as.Date("2011-01-01")
end=as.Date("2018-01-01")
getSymbols("AAPL", src="yahoo", from=start, to=end)
## 'getSymbols' currently uses auto.assign=TRUE by default, but will
## use auto.assign=FALSE in 0.5-0. You will still be able to use
## 'loadSymbols' to automatically load data. getOption("getSymbols.env")
## and getOption("getSymbols.auto.assign") will still be checked for
## alternate defaults.
## 
## This message is shown once per session and may be disabled by setting 
## options("getSymbols.warning4.0"=FALSE). See ?getSymbols for details.
## 
## WARNING: There have been significant changes to Yahoo Finance data.
## Please see the Warning section of '?getSymbols.yahoo' for details.
## 
## This message is shown once per session and may be disabled by setting
## options("getSymbols.yahoo.warning"=FALSE).
## [1] "AAPL"
plot.ts(AAPL$AAPL.Close, main="AAPL Daily Stock Prices from 1 Jan 2011-01 to 1 Jan 2018", ylab="$ / Share")

describe(AAPL)
 
             vars    n        mean          sd     median
AAPL.Open        1 1761       95.60       32.12 9.4640e+01
AAPL.High        2 1761       96.40       32.29 9.5570e+01
AAPL.Low         3 1761       94.74       31.95 9.3650e+01
AAPL.Close       4 1761       95.59       32.14 9.4560e+01
AAPL.Volume      5 1761 76706134.47 54160499.36 6.2777e+07
AAPL.Adjusted    6 1761       84.43       37.75 8.7030e+01


                  trimmed         mad         min          max
AAPL.Open           93.53       33.64       45.24       175.11
AAPL.High           94.35       33.79       45.39       177.20
AAPL.Low            92.66       33.25       44.36       174.86
AAPL.Close          93.52       33.73       45.05       176.42
AAPL.Volume   68579367.99 44912401.80 11475900.00 470249500.00
AAPL.Adjusted       81.93       45.14       30.27       174.42



                     range skew kurtosis         se
AAPL.Open           129.87 0.44    -0.55       0.77
AAPL.High           131.81 0.43    -0.56       0.77
AAPL.Low            130.50 0.45    -0.55       0.76
AAPL.Close          131.37 0.44    -0.55       0.77
AAPL.Volume   458773600.00 1.71     4.43 1290633.64
AAPL.Adjusted       144.15 0.39    -0.84       0.90