Running examples in 'cwbtools-Ex.R' failed
The error most likely occurred in:

> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
> ### Name: CorpusData
> ### Title: Manage Corpus Data and Encode CWB Corpus.
> ### Aliases: CorpusData
> ### Keywords: datasets
> 
> ### ** Examples
> 
> library(RcppCWB)
> library(data.table)
> 
> # this example relies on the R method to write data to disk, there is also a method "CWB"
> # that relies on CWB tools to generate the indexed corpus. The CWB can downloaded
> # and installed within the package by calling cwb_install()
> 
> # create temporary registry file so that data in RcppCWB package can be used
> 
> registry_rcppcwb <- system.file(package = "RcppCWB", "extdata", "cwb", "registry")
> registry_tmp <- file.path(normalizePath(tempdir(), winslash = "/"), "registry")
> if (!dir.exists(registry_tmp)) dir.create(registry_tmp)
> r <- registry_file_parse("REUTERS", registry_dir = registry_rcppcwb)
> r[["home"]] <- system.file(package = "RcppCWB", "extdata", "cwb", "indexed_corpora", "reuters")
> registry_file_write(r, corpus = "REUTERS", registry_dir = registry_tmp)
> 
> # decode structural attribute 'places'
> 
> s_attrs_places <- RcppCWB::s_attribute_decode(
+   corpus = "REUTERS",
+   data_dir = system.file(package = "RcppCWB", "extdata", "cwb", "indexed_corpora", "reuters"),
+   s_attribute = "places", method = "R"
+ )
> s_attrs_places[["id"]] <- 1L:nrow(s_attrs_places)
> setnames(s_attrs_places, old = "value", new = "places")
> 
> # decode positional attribute 'word'
> 
> tokens <- apply(s_attrs_places, 1, function(row){
+   ids <- cl_cpos2id(
+     corpus = "REUTERS", cpos = row[1]:row[2],
+     p_attribute = "word", registry = registry_tmp
+   )
+   cl_id2str(corpus = "REUTERS", id = ids, p_attribute = "word", registry = registry_tmp)
+ })
> tokenstream <- rbindlist(
+ lapply(
+   1L:length(tokens),
+   function(i) data.table(id = i, word = tokens[[i]]))
+   )
> tokenstream[["cpos"]] <- 0L:(nrow(tokenstream) - 1L)
> 
> # create CorpusData object (see vignette for further explanation)
> 
> CD <- CorpusData$new()
> CD$tokenstream <- as.data.table(tokenstream)
> CD$metadata <- as.data.table(s_attrs_places)
> 
> # Remove temporary registry with home dir still pointing to RcppCWB data dir
> # to prevent data from being deleted
> file.remove(file.path(registry_tmp, "reuters"))
[1] TRUE
> file.remove(registry_tmp)
[1] TRUE
> 
> # create temporary directories (registry directory and one for indexed corpora)
> 
> tmpdir <- normalizePath(tempdir(), winslash = "/")
> if (.Platform$OS.type == "windows") tmpdir <- normalizePath(tmpdir, winslash = "/")
> registry_tmp <- file.path(tmpdir, "registry", fsep = "/")
> data_dir_tmp <- file.path(tmpdir, "data_dir", fsep = "/")
> if (!dir.exists(registry_tmp)) dir.create(registry_tmp <- file.path(tmpdir, "registry", fsep = "/"))
> if (!dir.exists(data_dir_tmp)) dir.create(data_dir_tmp <- file.path(tmpdir, "data_dir", fsep = "/"))
> 
> CD$encode(
+   corpus = "REUTERS", encoding = "utf8",
+   p_attributes = "word", s_attributes = "places",
+   registry_dir = registry_tmp, data_dir = data_dir_tmp,
+   method = "R"
+ )
Creating new corpus 'REUTERS'
... encoding p-attribute 'word'
... writing tokenstream to disk (directly from R, equivalent to cwb-encode)
... creating indices (in memory)
... writing file: word.corpus
... writing file: word.lexicon
... writing file: word.lexicon.idx
... creating data for new registry file
... writing registry file
=== Makeall: processing corpus REUTERS ===
Registry directory: /tmp/RtmpnlIrhs/registry
ATTRIBUTE word
 - lexicon      OK
 - frequencies  OK
 - token stream OK (COMPRESSED)
 - index        OK (COMPRESSED)
========================================
... encoding s-attribute 'places'
Error in s_attribute_encode(values = self$metadata[[s_attr]], corpus = corpus,  : 
  class(region_matrix) == "matrix" are not all TRUE
Calls: <Anonymous> -> s_attribute_encode -> stopifnot
Execution halted