Skip to contents

This function writes an object of class conc to a file.

Usage

write_conc(x, file = "", sep = "\t")

Arguments

x

Object of class conc.

file

Path to output file.

sep

Field separator for the columns in the output file.

Value

Invisibly, x.

See also

Examples

(d <- conc('A very small corpus.', '\\w+', as_text = TRUE))
#> Concordance-based data frame (number of observations: 4)
#> idx                                           left|match |right             
#>   1                                               |  A   |very small corpus.
#>   2                                              A| very |small corpus.     
#>   3                                         A very|small |corpus.           
#>   4                                   A very small|corpus|.                 
#> 
#> This data frame has 6 columns:
#>    column
#> 1 glob_id
#> 2      id
#> 3  source
#> 4    left
#> 5   match
#> 6   right
.old_wd <- setwd(tempdir())
write_conc(d, "example_data.tab")
(d2 <- read_conc("example_data.tab"))
#> Concordance-based data frame (number of observations: 4)
#> idx                                           left|match |right             
#>   1                                               |  A   |very small corpus.
#>   2                                              A| very |small corpus.     
#>   3                                         A very|small |corpus.           
#>   4                                   A very small|corpus|.                 
#> 
#> This data frame has 6 columns:
#>    column
#> 1 glob_id
#> 2      id
#> 3  source
#> 4    left
#> 5   match
#> 6   right
setwd(.old_wd)