Learn R Programming

geo (version 1.4-3)

s2pre: Writes out data.frame or matrix to a prelude-file.

Description

Data.frame or matrix object is written to a prelude-file, that inherits names/dimnames attributes from the object.

Usage

s2pre(data, file = "splus.pre", na.replace = "")

Arguments

data
Data.frame or matrix object.
file
Name of the output file ("Splus.pre" by default).
na.replace
A character to replace NA with in the output file ("" by default).

Value

A prelude-file representation of the data-object is written to a file.

Side Effects

No warning is given if the filename "file" already exists -- it is simply over-written.

See Also

cat, write.

Examples

Run this code
## Not run: Within Splus:
#        > tmp.test.frame
#           tolur1     tolur2 stafir1
#         1     11 0.04625551       a
#         2     12 0.04845815       a
#         3     13 0.05066079      NA
#         4     14 0.05286344       a
#         5     15 0.05506608       a
#         6     16 0.05726872       b
#         7     17 0.05947137       b
#         8     18         NA       b
#         9     19 0.06387665       b
#        10     20 0.06607930       b
#        > s2pre(tmp.test.frame,file="prufa.pre",na.replace="-1")
#        >
# 
#        From UNIX:
# 
#        hafbitur/home/reikn/gardar/Papers/Methods95 [435] cat prufa.pre
#        linu_nofn       tolur1  tolur2  stafir1
#        ---------       ------  ------  -------
#        1       11      0.04625551      a
#        2       12      0.04845815      a
#        3       13      0.05066079      -1
#        4       14      0.05286344      a
#        5       15      0.05506608      a
#        6       16      0.05726872      b
#        7       17      0.05947137      b
#        8       18      -1      b
#        9       19      0.06387665      b
#        10      20      0.06607930      b
#        hafbitur/home/reikn/gardar/Papers/Methods95 [436]
# ## End(Not run)

Run the code above in your browser using DataLab