readNFI {basifoR}R Documentation

Read NFI data


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 ("") or paths to files locally stored.


readNFI(nfi, dt.nm = "PCMayores", 



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


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.


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 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.


data.frame. A data base of the NFI.


Wilson Lara <>, Cristobal Ordonez <>, Felipe Bravo <>


madridNFI <- system.file("", package="basifoR")
rmad <- readNFI(madridNFI)[1:100,]

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

path <- '/es/biodiversidad/servicios/banco-datos-naturaleza/'
url2 <- httr::modify_url("", path = path)
rnfi <- readNFI(url2)

[Package basifoR version 0.4 Index]