0
下面是使用quantmod繪製函數圖形的R代碼,但限制只能輸出一個圖形。有沒有辦法讓你的函數輸出多於一個圖形,說設置內容text/html
,並以某種方式使用它來渲染多個圖形?你能向我解釋怎麼做?要解決這個如何使用R-Apache輸出多個圖形
tickergraph = function()
{
setContentType ("image/png")
temp <- tempfile()
png (temp, type="cairo")
ticker <- toupper(POST$t);
getSymbols(ticker)
chartSeries(eval(parse(text=ticker)))
dev.off()
sendBin (readBin (temp, 'raw', n=file.info(temp)$size))
unlink (temp)
}
if(!is.null(POST$t))
{
tickergraph()
print(POST)
}
print("Cannot Plot when some of the values are NULL")
爲什麼不在「」標籤中顯示保存的圖像?那麼你可以有多少你想要的。 –
我如何獲得圖像源?它將其存儲在網站目錄 –
以外的臨時文件中。「It」只會執行您告訴它的內容,因此將其存儲在網站目錄內的永久文件中。 –