pq_opr: dataframe operation

pq_oprR 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)


ShichenXie/pedar documentation built on April 7, 2024, 5:18 p.m.