R/dirFTP.R

#' List Files in FTP Site
#' @param myURL A string
#' @param codibge A string
#' @return A dataframe with IBGE files for one municipality
#' @export
dirFTP <- function (myURL="", codibge=""){
  ibgecode <- getURL(myURL,ftp.use.epsv=F,dirlistonly=T)
  ibgecode <- paste(strsplit(ibgecode, "\r*\n")[[1]], sep = "")
  listaIBGE <- as.data.frame(ibgecode)
  listaIBGE <- subset(listaIBGE,codibge == substring(listaIBGE$ibgecode,1,7))
  return(listaIBGE)
}

Try the AmostraBrasil package in your browser

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

AmostraBrasil documentation built on May 2, 2019, 2:09 p.m.