readNFI {basifoR} | R Documentation |
Read NFI data
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
readNFI(nfi, dt.nm = "PCMayores",
...)
Arguments
nfi |
|
dt.nm |
|
... |
Additional arguments in |
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
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)