dataFrame.column.stat — diffRel()
Description
The diffRel() method of the stat object returns an array containing the relative change between consecutive values in the selected column.
Signature
dataFrame.column(columnName).stat.diffRel()Argument
columnName(string)- The name of the column from which to calculate the differences.
Returns
mask( number[] )- An array containing the relative differences.
Example
// get relative differences between values of a column of the dataFrame
var mask = dataFrame.column('revenue').stat.diffRel();
// add the differences to the dataFrame
dataFrame.column('differences').set(mask);