This is my data frame:
structure(list(alpha = c(0.1, 0.5), w = c(-0.00274974306224061,
-0.000196166328114611), w_sd = c(0.0551810481758757, 0.0578592391790738
), x = c(33.1362337290378, 39.5506108643837), x_sd = c(3.1665690944253,
3.326430870477), y = c(-5.31333502177223e-05, 0.000993858599634651
), y_sd = c(0.00281795557473473, 0.00521256102447982), z = c(7.36644492272648,
0.948467218571388), z_sd = c(3.51648260725539, 3.66294238952056
)), row.names = c(NA, -2L), class = c("tbl_df", "tbl", "data.frame"
))
I would like it to look like this:
alpha | stock | mean | sd
0.1 | x
0.5 | x
0.1 | y
0.5 | y
0.1 | z
0.5 | z
0.1 | z
0.5 | z
Where the mean and sd columns contain the values from w, x, etc and w_sd, x_sd, etc, respectively.
EDIT: Note that "alpha" is the input into a function through the argument parameter.