powered by
It performs arithmetic operation on numeric columns on multiple series.
pq_opr(dt, opr, x = "close", rm_na = FALSE, ...)
a list/dataframe of time series datasets.
operation string.
the numeric column names, defaults to close.
weather to remove NA values when perform arithmetic.
additional parameters.
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)
Run the code above in your browser using DataLab