Learn R Programming

basifoR (version 0.4.1)

urlToTemp: Temporary NFI data

Description

This function is implemented by other routines of the package to decompress .zip files with data sets of the SNFI.

Usage

urlToTemp(url., timeOut = timeout(60))

Value

character. Path to the NFI data (.mdb or .dbf) stored in a temporary file

Arguments

url.

character. URL/path to a compressed file of the SNFI (.zip) having data of either .dbf or .mdb file extensions..

timeOut

request. Maximum request time, see timeout. Default timeout(60)

Author

Wilson Lara <wilarhen@gmail.com> [aut, cre] (<https://orcid.org/0000-0003-3527-1380>), Cristobal Ordonez <a_cristo@pvs.uva.es> [aut] (<https://orcid.org/0000-0001-5354-3760>), Felipe Bravo <fbravo@pvs.uva.es> [aut] (<https://orcid.org/0000-0001-7348-6695>)

Details

The data sets are decompressed in a temporary file of the local machine. Compressed data containing file extensions other than .mdb or .dbf are not supported.

Examples

Run this code
madridNFI <- system.file("ifn3p28_tcm30-293962.zip", package="basifoR")
tfmad <- urlToTemp(madridNFI)
tfmad

## Internet resources fail gracefully with an informative message if
## the resource is not available or has changed (and not give a check
## warning nor error):

path <- '/es/biodiversidad/servicios/banco-datos-naturaleza/090471228013cbbd_tcm30-278511.zip'
url2 <- httr::modify_url("https://www.miteco.gob.es", path = path)

tfmad <- urlToTemp(url2, timeOut=timeout(1))


Run the code above in your browser using DataLab