[R-SIG-Finance] Trying to Extract Option Quotes with R
Frank
frankm60606 at gmail.com
Fri May 12 20:02:07 CEST 2017
It looks like some of the dependencies don't load automatically. I was using
R x64 3.2.2:
1) Updated my R to the later version
2) I installed package jsonlite ("package:"jsonlite"cannot be loaded.")
3) I installed package curl ("Error: Required package curl not found. Please
run: install.packages('curl')"
4) I updated to R x64 3.2.5 then R x64 3.3.3 re-installed the above.
I now get
" Error in data.frame(Strike = strike, Last = lastprice, Chg = change, Bid =
bid, :
object 'contractsymbol' not found"
The complete output is now:
"
version 3.3.3 (2017-03-06) -- "Another Canoe"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> 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.
> optData = getOptionChain( "XOM", Exp=NULL )
Error in data.frame(Strike = strike, Last = lastprice, Chg = change, Bid =
bid, :
object 'contractsymbol' not found
Calls: getOptionChain ... <Anonymous> -> with -> with.default -> eval ->
eval -> data.frame
Execution halted
-----Original Message-----
From: R-SIG-Finance [mailto:r-sig-finance-bounces at r-project.org] On Behalf
Of Robert Sherry
Sent: Friday, May 12, 2017 11:35 AM
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] Trying to Extract Option Quotes with R
I executed the following commands in R:
library(quantmod)
optData = getOptionChain( "XOM", Exp=NULL )
nrow(optData)
The last command returned NULL. What am I doing wrong?
Bob
_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions
should go.
More information about the R-SIG-Finance
mailing list