在我使用R kernel的jupyter笔记本中,我可以获得如下的过程提示:
pausing 1 second between requests for more than 5 symbols
我的问题是,如果我想隐藏单元格下面的消息怎么办?
正如您所看到的,我尝试了options(warn=-1)
,但它无法正常工作。整个代码单元格是:
etf_weekly_returns <- function(ticker) {
symbols <- getSymbols(ticker, auto.assign = TRUE, warnings = FALSE)
etf_prices <- do.call(merge, lapply(symbols, function(x) Cl(get(x))))
etf_returns <- do.call(merge, lapply(etf_prices,
function(x) periodReturn(x, period = 'weekly', type = 'log')))
#Change the column names to the sector names from our dataframe above.
colnames(etf_returns) <- etf_ticker_sector$sector
etf_returns
}
etf_returns <- etf_weekly_returns(etf_ticker_sector$ticker)
options(warn=-1)