I have a data.frame
with columns "a" and "b". I want to add columns called "high" and "low" that contain the highest and the lowest among columns a and b.
Is there a way of doing this without looping over the lines in the dataframe?
edit: this is for OHLC data, and so the high and low column should contain the highest and lowest element between a and b on the same line, and not among the whole columns. sorry if this is badly worded.
question from:https://stackoverflow.com/questions/5591593/is-there-a-vectorized-parallel-max-and-min