expr.frame: Expression Frames

Description Usage Arguments Author(s) See Also Examples

Description

An object of class "expr.frame" is a data.frame with an attribute exprlist containing a named list of quoted expressions. The evaluation of these expressions are columns of the data frame.

Usage

1
2
3
4

Arguments

x

Object of class "expr.frame".

exprlist

a named list of quoted expressions.

Author(s)

Robert Sams robert@sanctumfi.com

See Also

inside

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
d <- spx[1:10,]

## exprlist assigment creates 'expr.frame' object
d <- expr.frame(d, list(RoR=quote(c(1, Close[-1] / Close[-length(Close)]))))
class(d); d

## We can now add/modify with the $ assignment method instead
d$Rtn <- quote(RoR - 1)
d$Close <- d$Close * 1.01
## d$RoR <- quote(ror(Close, delta=1/Close)) ## !!! Why Error? !!!
exprlist(d); d

## Retreive original data
coredata(d) 

## Coercion
as.data.frame(d)
as.list(d)
as.matrix(d)
as.zoo(d, order.by=rownames(d))

## Subsetting
d[1:2]
d$ror
## d[, 1:7] ## !!! FIX ME !!!

tradesys documentation built on May 2, 2019, 4:53 p.m.