read_dataset: Read a linguistic dataset (of the type used in 'mclm')

Description Usage Arguments Value See Also Examples

Description

Reads datasets of the type that are written to file with the function write_dataset. In principle, it should also be possible to read such datasets with the function read.table, but in some locales the function read_dataset can prove to be slightly more robust in case the files contain Non-Western language data.

Usage

1
2
3
4
5
6
7
8
read_dataset(file,
             header = TRUE,
             sep = "\t",
             quote = "",
             comment_char = "",
             file_encoding = "UTF-8",
             stringsAsFactors = default.stringsAsFactors(),
             ...) 

Arguments

file

name of the input file

header

boolean value that expresses whether or not the first line in the input file contains column names. In the current implementation of read_dataset, the value of header is ignored and is assumed to be TRUE.

sep

the field separator that is used in the input file.

quote

boolean value that expresses whether or not character data fields in the file are enclosed in quotation marks. This argument is not used in the current implementation of read_dataset. For the moment, character data are assumed not to be enclosed in quotes.

comment_char

not used in the current implementation of read_dataset. For the moment the comment character mechanism is disabled.

file_encoding

the encoding used in the input file.

stringsAsFactors

boolean value: should character data automatically be converted to factors?

...

not used in the current implementation of read_dataset.

Value

The function read_dataset returns a data frame.

See Also

See also write_dataset.

Examples

1
2
3
4
d <- conc_re('\\w+', 'A very small corpus.', as_text = TRUE)
write_dataset(d, "example_data.tab")
d2 <- read_dataset("example_data.tab")
d2

wai-wong-reimagine/mclm documentation built on May 16, 2019, 9:12 p.m.