[R-SIG-Finance] Save a plot

Pedro páramo percent||101 @end|ng |rom gm@||@com
Tue Jul 28 22:46:04 CEST 2020


Hi all I want to save a code on a png but it saves me a png with 0k
(nothing on the plot) but I see it on R-Studio. No error is happening, what
should be happening?

Many thanks for your help

library(PerformanceAnalytics)
library(dplyr)
library(tibble)
library(lubridate)
library(PerformanceAnalytics)
library(quantmod)
library(ggplot2)
library(png)
library(grid)
library(RCurl)

Eurostoxx50<-getSymbols(src='yahoo',"^STOXX50E",  env =
parent.frame(),from="2019-12-31")
Ibex35<-getSymbols("^IBEX", env = parent.frame(),from="2019-12-31")
SP500<-getSymbols("^GSPC", env = parent.frame(),from="2019-12-31")
Nasdaq<-getSymbols("^IXIC", env = parent.frame(),from="2019-12-30")

ret <-
na.omit(CalculateReturns(cbind(Cl(IBEX),Cl(STOXX50E),Cl(GSPC),Cl(IXIC))) )
# same as Cl(AAPL)/lag(Cl(AAPL)) - 1))
chart.CumReturns(ret,wealth.index = TRUE,legend.loc = "bottomleft",
yaxis.pct=100)
title("SP500 reval", adj = 0, line = 3, cex.main=1.25)
title("Eco", adj = 0.75, line = -22)
png("plot-1.png", width=1000, height=600)

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list