View source: R/functioncollection_import.R
ReadGeoData | R Documentation |
Import a GeoData file into R.
ReadGeoData(
filename = "GeoData.txt",
sep = "\t",
encoding = c("unknown", "UTF-8", "Latin-1"),
remove.na.cols = TRUE
)
filename |
Path to and file name of the GeoData file to import. Windows users: Note that Paths are separated by '/', not '\'. |
sep |
character string. Field separator character as described in |
encoding |
Character string, encoding of non-ascii characters in imported text file. Particularly relevant when
importing files created under Windows (default encoding "Latin-1") in Linux (default encoding "UTF-8") and vice versa. See
also argument description in |
remove.na.cols |
Logical, remove columns which have all NA values. |
ReadGeoData
uses fread
from the data.table::data.table package
with type numeric
type for columns AREA
and RIVLEN
(if they exist), and
upper-case column names.
If the imported file is a HYPE-conform GeoData file, ReadGeoData
returns an object of S3 class HypeGeoData
(see the class description there), providing its own summary
method. If mandatory GeoData columns are missing,
a standard dataframe is returned along with informative warning messages.
te <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
summary(te)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.