Skip to content
Prev 367603 / 398500 Next

Reverse the scoring of some Columns of a Data Set

On 3/8/2017 6:14 AM, AbouEl-Makarim Aboueissa wrote:
If your data is in a data frame called df, you could do something like 
this:

df[,1:3] <- apply(df[,1:3], 2, function(x) x[length(x):1])


Hope this helps,

Dan