readList: Import Data

View source: R/readList.R

readListR Documentation

Import Data

Description

Import data arranged on lines into a list.

Usage

readList(file, names = TRUE, sep = "", nlines = 1, convert = NULL)

Arguments

file

a character string specifying the name of the file.

names

logical, if TRUE, then take component names from the first entry in the line. If FALSE, then the components are sequentially numbered.

sep

the separator character for the data in each line. If a blank string (the default), then any white space is taken as the separator.

nlines

the number of lines that represent a single collection of data,

convert

character string indicating how to convert the data. Must be a valid value for the Class argument of as.

Value

A list with one component for each nlines in the input file.

See Also

as

Examples

# Make a 3-line example dataset with component names A, B, and C.
cat("A 1 2 3 4\nB 5 6 7\nC 8 9\n", file="readList.test")
# Read the example dataset
readList("readList.test")

USGS-R/smwrBase documentation built on Oct. 18, 2022, 9:55 a.m.