asoutput: Character Output

Description Usage Arguments Details Value Author(s) Examples

Description

Create objects of class output.

Usage

1

Arguments

x

object to be converted to an instance of output.

...

optional arguments to be passed to implementing methods of as.output. Most methods support the following arguments: sep string, column/value separator, nsep string, key separator, keys either a logical (if FALSE names/row names are suppressed) or a character vector with overriding keys. The default for keys typically varies by class or is auto-detected (e.g., named vectors user names as keys, data.frames use row names if they are non-automatic etc.). All methods also support con argument which pushes the output into a connection instead of generating an output object - so as.output(x, con=...) is thus not a coersion but used only for its side-effect. Note that con also supports special values iotools.stdout, iotools.stderr and iotools.fd(fd) which write directly into the corresponding streams instead of using theconnection API.

Details

as.output is generic, and methods can be written to support new classes. The output is meant to be a raw vector suitable for writing to the disk or sending over a connection.

Value

if con is set to a connection then the result is NULL and the method is used for its side-effect, otherwise the result is a raw vector.

Side note: we cannot create a formal type of output, because writeBin does is.vector() check which doesn't dispatch and prevents anything with a class to be written.

Author(s)

Simon Urbanek

Examples

1
2
3
4
5
6
7

Example output

 [1] 6f 7c 73 0a 72 7c 68 0a 79 7c 66 0a 71 7c 6e 0a 75 7c 7a 0a 63 7c 6c 0a 77
[26] 7c 61 0a 67 7c 6b 0a 70 7c 78 0a 74 7c 65 0a 76 7c 69 0a 62 7c 6d 0a 6a 7c
[51] 64 0a
 raw [1:596] 7a 7c 30 2e ...
z|0.35882578138262|MN
m|0.615804363507777|OH
k|0.789794727461413|FL
t|0.587380488635972|WA
d|0.623798619722947|GA
x|0.0130412434227765|DE
w|0.504290564218536|MA
o|0.751359159592539|MD
e|0.762479856377468|AK
p|0.622686769114807|LA
r|0.870583358453587|AR
j|0.808102610753849|VT
g|0.393065227894112|NE
v|0.31924637616612|NY
n|0.0835207579657435|PA
h|0.64706058613956|MI
q|0.274165001465008|WY
l|0.645602969685569|HI
c|0.85634833551012|NV
s|0.159116968046874|MS
a|0.313045824877918|WI
b|0.904527654405683|KS
i|0.197170551633462|MO
y|0.366072229808196|KY
u|0.692264944780618|CT
f|0.976222651079297|AZ
NULL

iotools documentation built on July 23, 2021, 9:07 a.m.