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

Description Usage Arguments Value Side Effects See Also Examples

View source: R/s2pre.R

Description

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

Usage

1
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## 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)

geo documentation built on May 29, 2017, 5:36 p.m.