我的页面中有一个文本框,其中包含位置名称和带文本的按钮getLat&Long.现在单击我的按钮,我必须在文本框中显示警报latitude和longitude位置.有什么建议吗?
我使用R包quantmod没有问题,它使用Yahoo来获取股票数据,如下所示:
get_stock_prices <- function(target, return_format = "tibble", ...) {
# Get stock prices
print(target)
stock_prices_xts <- getSymbols(Symbols = target, auto.assign = FALSE, ...)
# Rename
names(stock_prices_xts) <- c("Open", "High", "Low", "Close", "Volume", "Adjusted")
# Return in xts format if tibble is not specified
if (return_format == "tibble") {
stock_prices <- stock_prices_xts %>%
as_tibble() %>%
rownames_to_column(var = "Date") %>%
mutate(Date = ymd(Date))
} else {
stock_prices <- stock_prices_xts
}
write.csv(stock_prices, file = paste(target, "csv", sep = '.'))
}
Run Code Online (Sandbox Code Playgroud)
我只知道Python中的pandas_datareader来实现类似的东西.不幸的是,随着雅虎和谷歌API的变化,这个包破产了.这段代码:
import pandas_datareader …Run Code Online (Sandbox Code Playgroud)