Learn R Programming

geoR (version 1.2-5)

read.geodata: Reads and Converts Data to geoR Format

Description

Reads data from a ASCII file and converts it to an object of the class geodata, the standard data format for the geoR package.

Usage

read.geodata(file, header = FALSE, coords.col = 1:2, data.col = 3,
             data.names = NULL, covar.col = NULL,
             covar.names = "header", realisations = NULL, ...)

Arguments

file
a string with the name of the ASCII file.
header
logical. Indicates whether the variables names should be read from the first line of the input file.
coords.col
a vector with the numbers of the columns containing the coordinates.
data.col
a scalar or vector with the number of the column(s) containing the data.
data.names
a string or vector of strings with names for the data columns. Only valid if there is more than one column of data. By default the names in the original object are used.
covar.col
optional. A scalar or vector with the number of the column(s) with the values of the covariate(s).
covar.names
a string or vector of strings with the name(s) of the covariates. By default the names in the original object are used.
realisations
optional. A vector indicating the replication number. For more details see documentation for as.geodata.
...
further arguments to be passed to the function read.table.

Value

  • An object of the class geodata. See documentation for the function as.geodata for further details.

Details

The function read.table is used to read the data from the ASCII file and then as.geodata is used to convert to an object of the class geodata.

References

Further information about geoR can be found at: http://www.maths.lancs.ac.uk/~ribeiro/geoR.

See Also

as.geodata to convert existing Robjects, read.table, the basic Rfunction used to read ASCII files, and list for detailed information about lists.