showTexts: Exports Readable Text Lists

Description Usage Arguments Value Examples

View source: R/showTexts.R

Description

Exports the article id, text, title and date.

Usage

1
showTexts(object, id = names(object$text), file, fileEncoding = "UTF-8")

Arguments

object

textmeta object

id

Character vector or matrix including article ids

file

Character Filename for the export. If not specified the functions output ist only invisible.

fileEncoding

character string: declares file encoding. For more information see write.csv

Value

A list of the requested articles. If file is set, writes a csv including the meta-data of the requested articles.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
texts <- list(A="Give a Man a Fish, and You Feed Him for a Day.
Teach a Man To Fish, and You Feed Him for a Lifetime",
B="So Long, and Thanks for All the Fish",
C="A very able manipulative mathematician, Fisher enjoys a real mastery
in evaluating complicated multiple integrals.")

corpus <- textmeta(meta=data.frame(id=c("A", "B", "C", "D"),
title=c("Fishing", "Don't panic!", "Sir Ronald", "Berlin"),
date=c("1885-01-02", "1979-03-04", "1951-05-06", "1967-06-02"),
additionalVariable=1:4, stringsAsFactors=FALSE), text=texts)

exportedTexts <- showTexts(object=corpus, id = c("A","C"))

tosca documentation built on Oct. 28, 2021, 5:07 p.m.