Learn R Programming

DataMetProcess (version 1.0.8)

list_inmet: List of data available at INMET by year

Description

Collects the available files for the year and returns a list containing: 1) a table containing the addresses of each file inside the zip for later extraction by the down_inmet() function, 2) Yearther structured table with the information available in the file name (e,g, city, station code, year, date of start and end date) and 3) the address of the zip file.

Usage

list_inmet(year = NULL, filename = NULL)

Value

List containing: 1) a table containing the addresses of each file inside the zip for later extraction by the unzip() function of the utils package, 2) Yearther structured table with the information available in the file name (e,g, city, station code, year, date of start and end date) and 3) the address of the zip file.

Arguments

year

year for download in the INMET database

filename

string containing the path and name of the file with the extension ".zip", if NULL (default) it will be saved in a temporary file

Examples

Run this code

file.down <- tempfile()
file.save <- tempfile()

info.inmet <-
  DataMetProcess::list_inmet(year="2000",file.down)

unzip.file <-
  utils::unzip(
    zipfile = file.down, #or info.inmet$Saved
    exdir = file.save
  )

unzip.file


Run the code above in your browser using DataLab