pq_opr {pedquant}R Documentation

dataframe operation

Description

It performs arithmetic operation on numeric columns on multiple series.

Usage

pq_opr(dt, opr, x = "close", rm_na = FALSE, ...)

Arguments

dt

a list/dataframe of time series datasets.

opr

operation string.

x

the numeric column names, defaults to close.

rm_na

weather to remove NA values when perform arithmetic.

...

additional parameters.

Examples

data("dt_banks")

dt1 = pq_opr(dt_banks, '601288.SH/601988.SH')
print(dt1)

dt2 = pq_opr(dt_banks, c('(601288.SH+601988.SH)/2', '(601288.SH*601988.SH)^0.5'))
print(dt2)


[Package pedquant version 0.2.4 Index]