Learn R Programming

Kmisc (version 0.5.0)

extract_rows_from_file: Extract Rows from File

Description

This function reads through a delimited file on disk, determines if the entry at the specified column is in a character vector of items, and writes that line to file (or to R) if it is.

Usage

extract_rows_from_file(file, out = NULL, column, sep = NULL, keep)

Arguments

file
The input file to extract rows from.
out
The location to output the file. If this is NULL, we redirect output back into the R session.
column
The column to check, indexed from 1.
sep
The delimiter used in file. Must be a single character. If no delimiter is specified, we guess the delimiter from the first row of file.
keep
A character vector containing all items that we want to check and keep within the columnth column of each row.

See Also

split_file