setdf: Set slot 'df'.

Description Usage Arguments Value Examples

Description

setdf sets the slot df.

Usage

1
2
3
4
setdf(object) <- value

## S4 replacement method for signature 'StfwfSchema,data.frame'
setdf(object) <- value

Arguments

object

object with the fwf file schema.

value

new data.frame with the specification of the schema.

Value

object with slot df updated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# A trivial example:
df <- data.frame(variable = c('Turnover', 'Employees'),
                 width = c(9L, 3L),
                 initialPos = c(1, 10),
                 finalPos = c(9, 12),
                 type = rep('num', 2),
                 valueRegEx = c('[0-9]{0,9}', '[0-9]{0,3}'),
                 description = c('Turnover of the business unit',
                                 'Number of employees of the business unit'),
                 stringsAsFactors = FALSE)
Schema <- new(Class = 'StfwfSchema')
setdf(Schema) <- df

david-salgado/fastReadfwf documentation built on Dec. 25, 2021, 12:43 p.m.