I have a data frame:
out.new_cost out1.new_cost out2.new_cost out3.new_cost out4.new_cost out5.new_cost
1 11049.18 11056.08 11948.41 11048.89 11049.18 11056.14
I would like each of these values to be a separate row. I would then like to add the following information as a column for each row:
alphas <- c(.005, .0005, .00005, .005, .0005, .00005)
thresholds <- c(.0000001, .0000001, .0000001, .0000001, .0000001, .0000001)
iterations <- c(200000, 200000, 200000, 2000000, 2000000, 2000000)
I tried to start by looking here and using:
reshape(costs, idvar = new_cost, direction = "long")
AND
reshape(costs, direction = "long")
but this returns the error:
Error in reshape(costs, direction = "long") : no 'reshapeWide' attribute, must specify 'varying'
What am I doing wrong and how can I fix it?