iotools (version 0.2-5)

as.output: Character Output

Description

Create objects of class output.

Usage

as.output(x, ...)

Arguments

x

object to be converted to an instance of output.

...

optional arguments to be passed to implementing methods of as.output. For matrix, and data.frame types this includes a sep argument indicating a field separator.

Value

as.output.default outputs a character vector by default, though other formats (such as a raw vector) may be returned by other methods.

Details

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

Examples

Run this code
# NOT RUN {
  m = matrix(sample(letters), ncol=2)
  as.output(m)

  df = data.frame(a = sample(letters), b = runif(26), c = sample(state.abb,26))
  as.output(df)
# }

Run the code above in your browser using DataLab