R/url2data.R

Defines functions url2data

Documented in url2data

url2data <- function(url.){
  fili <- names(url.)
  dati <- sapply(strsplit(fili, '\\.'), function(x)x[1:(length(x)-1)])
  n <- length(fili)
  found <- rep(NA, n)
  if(n>0)for(i in 1:n){
    chk <- try(utils::download.file(url.[i],
                              fili[i]))
    found[i] <- (c("TRUE", "FALSE")[1 +
               (class(chk)=="try-error")])
  }
  cbind(data=dati, file=fili, url=url.,
        found=found)
}

url_fts2 <- "http://faculty.chicagobooth.edu/ruey.tsay/teaching/fts2"

Try the FinTS package in your browser

Any scripts or data that you put into this service are public.

FinTS documentation built on May 29, 2024, 4:24 a.m.