Learn R Programming

RSurvey (version 0.4.3)

srvy.import-export: Import and Export Spatially Distributed Data

Description

This function imports and exports survey data.

Usage

srvy.import(file = NULL)
srvy.export(file = NULL)

Arguments

file
either a character string naming a file or a connection.

Value

  • The srvy.import function populates the data.raw, data.file, cols, and vars components of srvy.dat. The output of srvy.export is dependent on the file type chosen within the file management pop up dialog box. Choosing a file type of *.txt writes the contents of data.mod to a file, whereas a choice of *.tin writes the contents of data.tin to a file.

format

The tab delineated file, *.txt, contains the following variables: lll{ [,1] character date/time (optional) [,2] numeric x values [,3] numeric y values [,4:] numeric z values, state variable(s) } The first [1,] and second [2,] rows are reserved for column descriptors and units, respectively. Units associated with date/time values are based on format character strings described in strptime, for example "%d/%m/%Y %H:%M:%OS".

See Also

read.table

Examples

Run this code
## A sample file including a header and two rows of data.

## Date / Time	Easting	Northing	Depth
## \%d/\%m/\%Y \%H:\%M:\%OS	m	m	m
## 06/01/2001 01:01:59.000	727972.52	4138308.65	3.12
## 06/01/2001 01:01:59.200	727972.51	4138308.68	3.12

f <- system.file("RSurvey-ex/confluence.txt", package = "RSurvey")
con <- file(f, open = "r", encoding = "latin1")
srvy.import(file = con)
f <- paste(getwd(), "/test.txt", sep="")
con <- file(f, open = "w", encoding = "latin1")
srvy.export(file = con)

Run the code above in your browser using DataLab