[Experimental]

export_to_iramuteq() export atomic vectors to files with the format required by IRaMuTeQ for text corpuses (a collection of documents containing text).

export_to_iramuteq(
  x,
  dir = utils::choose.dir(),
  file_name = paste0(deparse(substitute(x)), ".txt"),
  var_name = "respondent"
)

Arguments

x

An atomic vector (usually a character object) with a corpus (a collection of documents containing text). Each element of x will represent a document (e.g., a response from a survey).

dir

(optional) a string indicating the directory on where the corpus files must be saved (default: utils::choose.dir()).

file_name

(optional) a string indicating the file name of the corpus.

var_name

(optional) a string indicating the variable name for each document. This is required by IRaMuTeQ for distinguish each document inside a corpus (default: "respondent").

Value

An invisible NULL. This function don't aim to return values.

Examples

if (FALSE) {
if (requireNamespace("friends", quietly = TRUE)) {
    export_to_iramuteq(head(friends::friends[[1]], 100),
                       dir = tempdir(), file_name = "test.txt")
}
}