Learn R Programming

HYPEtools (version 1.6.4)

WriteGeoData: Write a 'GeoData.txt' file

Description

This is a convenience wrapper function to export a 'GeoData.txt' file from R.

Usage

WriteGeoData(x, filename, digits = 6)

Value

No return value, called for export to text files.

Arguments

x

The object to be written, a dataframe, as an object returned from ReadGeoData. NAs in any column will result in a warning (no NAs allowed in GeoData data columns).

filename

A character string naming a file to write to. Windows users: Note that Paths are separated by '/', not '\'.

digits

Integer, number of significant digits in SLC class columns to export. See signif.

Details

WriteGeoData exports a GeoData dataframe using fwrite. SUBID and MAINDOWN columns are forced to non-scientific notation by conversion to text strings prior to exporting. For all other numeric columns, use fwrite argument scipen. HYPE does neither allow empty values in any GeoData column nor any string elements with more than 50 characters. The function will return with warnings if NAs or long strings were exported.

Examples

Run this code
te <- ReadGeoData(filename = system.file("demo_model", "GeoData.txt", package = "HYPEtools"))
summary(te)
WriteGeoData(x = te, filename = tempfile())

Run the code above in your browser using DataLab