Learn R Programming

tosca (version 0.3-4)

as.meta: "meta" Component of "textmeta"-Objects

Description

Helper to create the requested data.frame to create a "textmeta" object.

Usage

as.meta(
  x,
  cols = colnames(x),
  idCol = "id",
  dateCol = "date",
  titleCol = "title",
  dateFormat
)

Value

A data.frame with columns "id", "date", "title" and user-specified others.

Arguments

x

data.frame to convert

cols

character vector with columns which should be kept

idCol

character string with column name of the IDs

dateCol

character string with column name of the Dates

titleCol

character string with column name of the Titles

dateFormat

character string with the date format in x for as.Date. If not supplied, dates are not transformed.

Examples

Run this code
meta <- data.frame(id = 1:3, additionalVariable = matrix(5, ncol = 4, nrow = 3))
(as.meta(meta))

Run the code above in your browser using DataLab