readNFI: Read NFI data

Description Usage Arguments Details Value Author(s) Examples

Description

This function can retrieve data sets of the Spanish National Forest Inventory (SNFI). It can process either URLs to data stored in the SNFI web page ("http://www.miteco.gob.es") or paths to files locally stored.

Usage

1
2
readNFI(nfi, dt.nm = "PCMayores", 
    ...)

Arguments

nfi

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

dt.nm

character. Name of a data set stored in the imported NFI data. Default reads 'PCMayores' (3rd NFI) or 'PIESMA' (2nd NFI).

...

Additional arguments in urlToTemp.

Details

Compressed data having file extensions other than .dbf or .mdb are not supported. Most data bases in 2nd and 3rd stages of the SNFI can be imported directly from http://www.miteco.gob.es using appropriate URLs. Data sets from 2nd SNFI are imported using read.dbf. Data from latter stages are imported using either RODBC (Windows) or mdb.get (unix-alike systems). Data from 4th SNFI must be read from local paths. On Windows, a driver for Office 2010 can be installed via the installer 'AccessDatabaseEngine.exe' available from Microsoft, and the package must be implemented using a 32-bit R version. In the case of unix-alike systems, the linux dependence mdbtools must be installed.

Value

data.frame. A data base of the NFI.

Author(s)

Wilson Lara <wilarhen@gmail.com>, Cristobal Ordonez <a_cristo@pvs.uva.es>, Felipe Bravo <fbravo@pvs.uva.es>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
madridNFI <- system.file("ifn3p28_tcm30-293962.zip", package="basifoR")
rmad <- readNFI(madridNFI)[1:100,]
head(rmad)

## Retrieval of a data base from the second stage of the second SNFI:


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

basifoR documentation built on Sept. 20, 2021, 9:06 a.m.

Related to readNFI in basifoR...