有没有一种简单的方法可以将标题改为“通用电气”而不是“通用电气”?
chart.R
library(quantmod)
getSymbols("GE")
lineChart(GE)
答案 0 :(得分:1)
只需使用name
参数
lineChart(GE, name = "General Electric")
答案 1 :(得分:0)
这是一个完整的示例,如果有人使用新的chart_Series()需要它。
# create a pdf with titles
# R --silent --vanilla < c.r
suppressWarnings(suppressMessages(library(quantmod)))
options("getSymbols.warning4.0"=FALSE)
options("getSymbols.yahoo.warning"=FALSE)
# list of stocks
s= c("IBM", "AAPL", "GE", "GM")
# get symbols from yahoo
symbols <- list (getSymbols(s, source = "yahoo"))
# create a PDF
pdf(file = "out.pdf")
par(mfrow = c( 4, 2 ) )
chart_Series(IBM, name="IBM")
chart_Series(AAPL, name="Apple")
chart_Series(GE, name="General Electric")
chart_Series(GM, name="General Motors")
dev.off()