read_array: Read and write arrays

View source: R/io.R

read_arrayR Documentation

Read and write arrays

Description

Read data into an array from the console or file

Usage

read_array(file, sep = "", quote = "\"", skip = 0)

Arguments

file

either a character string naming a file or a connection which the data are to be read from or written to. "" indicates input from the console for reading and output to the console for writing.

sep

the field separator string. Values on each line of the file are separated by this string.

quote

the set of quoting characters as a single character string.

skip

the number of lines of the input file to skip before beginning to read data.

Details

The array can have one of several formats. The preferred format, produced by write.array, looks like cvar.nam rvar.1.nam ... rvar.k.nam cvar.lev.1 ... cvar.lev.l rvar.1.lev.1 ... rvar.k.lev.1 ... ... ...

Modified from rw1030/library/base/R/base/read.ftable

Value

An array.

Author(s)

Tom Minka

Examples

data(HairEyeColor)
fn <- tempfile()
write_array(HairEyeColor, fn)
read_array(fn)

paulemms/datamining documentation built on March 1, 2023, 4:01 p.m.