How can i dynamically generate a function-paramater in R?
I will use the paste0 function for different parameters for the line-function:
lines(paste0(gdaxisymbol[i],"$",gdaxisymbol[i],".Adjusted"))
It ends with an warning:
In xy.coords(x, y) : NAs durch Umwandlung erzeugt
thx
Hi, thx for your answer and sorry for the unclear question
Here is my full code:
library(XML)
library(RCurl)
s <- getURL("https://de.finance.yahoo.com/quote/^GDAXI/components")
t=readHTMLTable(s)
gdaxi = t[["NULL"]]
gdaxi = gdaxi[,-(3:6) ]
gdaxisymbol <- gdaxi$Symbol
getSymbols(gdaxisymbol,from="2015-12-31",to="2021-01-31", auto.assign = TRUE)
plot(ADS.DE$ADS.DE.Adjusted)
for(i in 1:30)
{
lines(paste0(gdaxisymbol[i],"$",gdaxisymbol[i],".Adjusted"))
}
I would like to print all Adujsted share prices in one Plot.
But if i execute the loop i become the error above.
How can i give the correct parameter dynamicaly to the lines function?
If i print one line with
lines(ALV.DE$ALV.DE.Adjusted)
it works fine.
thx
question from:
https://stackoverflow.com/questions/66047233/generate-a-function-parameter-in-r-with-paste-function 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…