read_vrt: Read and write VRT or WPL files

View source: R/io.R

read_vrtR Documentation

Read and write VRT or WPL files

Description

Import VRT (verticalized text) or WLP (word per line) files

Usage

read_vrt(file, no_xml = FALSE)

read_wpl(file, no_xml = FALSE)

write_vrt(file)

write_wpl(file)

Arguments

.x

character. path to file or connection, see scan()

header

logical. whether or not the first line should be used as column names. Note: names in cols take precedence.

cols

list. a list with column types (e.g. 0, for numeric, "" for character), if named, the names will be used as column/vector names. By default, column 1 is expected to contain integer frequencies and column 2 strings with types

sep

character. see scan

comment.char

character. off by default. replace if necessary

quote

character. see scan

na.strings

character. see scan

nlines

integer. number of lines in file, see nlines in scan()

...

further arguments to be passed to scan

Details

These formats are used by common corpus indexing software, like CWB (.vrt) and Sketchengine (.wpl). These functions are convenience wrappers with to read from and create such file formats.

Value

data.frame

See Also

read.table()


alex-raw/cwbwrapr documentation built on Oct. 23, 2022, 9:08 p.m.