R/getQuote.R

getQuote <- function(ticker) {
  tolower(ticker)
  url <- paste("https://stooq.pl/q/d/l/?s=", ticker, "&i=d", sep = "")
  download.file(url, destfile = "quote.csv")
  quote <- read.table(file = "quote.csv", sep = ",", header = TRUE, blank.lines.skip = TRUE, fill = TRUE)
  file.remove("quote.csv")

  return(quote)
}
knmontecarlo/getQuote documentation built on May 16, 2019, 9:29 a.m.