I am using the stats package R and would like to loop through column[x] in all the rows of a dataframe, operate on the data in each cell in the column with a function and pass the result to a new column (with the calculated result in the new column aligned with the data in column[x])
Two problems. 1) I can't get it to work and 2) looping seems to be discouraged in the R articles I've read. Is there an alternative approach and if not, does anyone have an example of how to carry out the loop? thanks.