全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
3280 0
2017-10-11
请问最后红色语句显示的是什么错误,怎样解决??




> library(quantmod)
载入需要的程辑包:xts
载入需要的程辑包:zoo

载入程辑包:‘zoo’

The following objects are masked from ‘package:base’:

    as.Date, as.Date.numeric

载入需要的程辑包:TTR
WARNING: You are configured to use the CRAN mirror at https://cran.rstudio.com/. This mirror supports secure (HTTPS) downloads however your system is unable to communicate securely with the server (possibly due to out of date certificate files on your system). Falling back to using insecure URL for this mirror.

To learn more and/or disable this warning message see the "Use secure download method for HTTP" option in Tools -> Global Options -> Packages.
Version 0.4-0 included new data defaults. See ?getSymbols.
Learn from a quantmod author: https://www.datacamp.com/courses ... financial-data-in-r
> library(PerformanceAnalytics)

Package PerformanceAnalytics (1.4.3541) loaded.
Copyright (c) 2004-2014 Peter Carl and Brian G. Peterson, GPL-2 | GPL-3
http://r-forge.r-project.org/projects/returnanalytics/


载入程辑包:‘PerformanceAnalytics’

The following object is masked from ‘package:graphics’:

    legend

> setSymbolLookup(WK=list(name='000002.sz',src='yahoo'))
> getSymbols("WK")
‘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] "WK"
Warning message:
000002.sz contains missing values. Some functions will not work if objects contain missing values in the middle of the series. Consider using na.omit(), na.approx(), na.fill(), etc to remove or replace them.
> sym.vec<-c("WK","^VIX")
> getSymbols(sym.vec,from="2016-07-01",to="2017-10-10")
[1] "WK"  "VIX"
> WK<-WK[,"000002.SZ.Adjusted",drop=F]
> WK.logret=CalculateReturns(WK,method="log")
> WK.logret[1]
           000002.SZ.Adjusted
2016-07-01                 NA
> WK.logret[1]-0.0
           000002.SZ.Adjusted
2016-07-01                 NA
> par(mfrow=c(3,1))
> plot(WK)
Error in gzfile(file, "wb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "wb") :
  cannot open compressed file 'C:/Users/???/AppData/Local/Temp/Rtmp4iR75X/rs-graphics-59821227-830a-44f5-a58d-0d653f8da2fb/1db66f22-137a-40e2-aec1-b3406b8d740d.snapshot', probable reason 'Invalid argument'
Graphics error: Plot rendering error
> plot(WK.logret)
Error in gzfile(file, "wb") : cannot open the connection
In addition: Warning message:
In gzfile(file, "wb") :
  cannot open compressed file 'C:/Users/???/AppData/Local/Temp/Rtmp4iR75X/rs-graphics-59821227-830a-44f5-a58d-0d653f8da2fb/13a2bf65-c4ac-4c64-88ae-7d1c89ee951c.snapshot', probable reason 'Invalid argument'
Graphics error: Plot rendering error

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群