refTable-constructor {Rgb} | R Documentation

## refTable class constructor

### Description

This function returns a new `refTable` object from various arguments.

Notice the `new()` alternative can be used to produce an empty object, setting only the fields not the content.

### Usage

      refTable(..., row.names, warn = TRUE)

### Arguments

`...` | A `data.frame`, a `list` or a set of named vectors to use as columns. For list and vectors, `row.names` will be used as row names if provided.
`row.names` | Character vector, the names of the rows for list or vector input.
`warn` | Single logical value, to be passed to the `refTable` `check` method.

### Value

An object of class `refTable`.

### Author(s)

Sylvain Mareschal

### See Also

`refTable-class`

### Examples

      # From vectors
      tab <- refTable(colA=1:5, colB=letters[1:5])
      print(tab$extract(3,))

      # From list (recycling)
      columns <- list(number=1, letters=LETTERS)
      tab <- refTable(columns)
      print(tab$extract())

      # data.frame conversion
      dataFrame <- data.frame(colA=1:5, colB=letters[1:5])
      tab <- refTable(dataFrame)
      print(tab$extract())

[Package Rgb version 1.6.1 Index]