I have got this df:
m_short <- structure(list(row = c("X1", "X2", "X3", "X1", "X2", "X3", "X1",
"X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3",
"X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2",
"X3", "X1", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3",
"X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2",
"X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1",
"X2", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1",
"X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3",
"X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2",
"X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1",
"X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3",
"X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2",
"X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1", "X2", "X3", "X1",
"X2", "X3", "X1", "X2", "X3"), column = c("X10", "X10", "X10",
"X11", "X11", "X11", "X12", "X12", "X12", "X13", "X13", "X13",
"X14", "X14", "X14", "X15", "X15", "X15", "X16", "X16", "X16",
"X17", "X17", "X17", "X18", "X18", "X18", "X19", "X19", "X19",
"X2", "X20", "X20", "X20", "X21", "X21", "X21", "X22", "X22",
"X22", "X23", "X23", "X23", "X24", "X24", "X24", "X25", "X25",
"X25", "X26", "X26", "X26", "X27", "X27", "X27", "X28", "X28",
"X28", "X29", "X29", "X29", "X3", "X3", "X30", "X30", "X30",
"X4", "X4", "X4", "X5", "X5", "X5", "X6", "X6", "X6", "X7", "X7",
"X7", "X8", "X8", "X8", "X9", "X9", "X9", "Y1", "Y1", "Y1", "Y10",
"Y10", "Y10", "Y11", "Y11", "Y11", "Y12", "Y12", "Y12", "Y13",
"Y13", "Y13", "Y14", "Y14", "Y14", "Y15", "Y15", "Y15", "Y16",
"Y16", "Y16", "Y17", "Y17", "Y17", "Y18", "Y18", "Y18", "Y19",
"Y19", "Y19", "Y2", "Y2", "Y2", "Y20", "Y20", "Y20", "Y3", "Y3",
"Y3", "Y4", "Y4", "Y4", "Y5", "Y5", "Y5", "Y6", "Y6", "Y6", "Y7",
"Y7", "Y7", "Y8", "Y8", "Y8", "Y9", "Y9", "Y9"), cor = c(0.068,
0.088, -0.082, 0.139, 0.094, 0.061, -0.07, -0.052, -0.076, -0.097,
0.067, -0.044, 0.166, 0.044, 0.023, 0.164, 0.026, 0.085, 0.083,
0.054, -0.031, 0.009, -0.023, -0.24, 0.017, -0.056, 0.195, 0.061,
-0.024, 0.053, 0.151, -0.062, -0.042, 0.006, 0.012, -0.006, -0.03,
-0.041, -0.086, -0.077, 0.002, -0.015, -0.033, 0.094, 0.046,
-0.116, 0.108, 0.391, 0.277, 0.052, 0.027, 0.114, -0.027, 0.18,
-0.117, 0.201, -0.025, 0.059, -0.108, 0, -0.036, 0.183, 0.179,
-0.201, 0.054, -0.05, -0.061, -0.009, -0.328, 0.051, -0.097,
-0.387, -0.195, -0.119, -0.648, -0.058, -0.065, -0.259, -0.21,
-0.102, 0.011, 0.028, 0.096, -0.169, 0.138, 0.144, -0.088, -0.074,
0.124, -0.114, -0.143, -0.026, 0.104, 0.053, 0.075, -0.246, 0.125,
-0.046, 0.125, 0.311, 0.139, 0.859, -0.091, 0.135, -0.091, 0.025,
-0.199, -0.067, 0.2, -0.2, 0.447, 0.224, 0.043, 0.073, -0.179,
0, 0, -0.099, -0.029, -0.115, -0.079, -0.091, -0.156, -0.117,
-0.131, 0.091, -0.024, -0.041, 0.079, 0.007, -0.167, 0.064, -0.053,
0.098, -0.035, 0.09, 0.172, -0.071, 0.107, -0.026, 0.096, -0.065,
-0.078, -0.017), p = c(0.345, 0.219, 0.251, 0.051, 0.188, 0.393,
0.329, 0.469, 0.286, 0.177, 0.353, 0.538, 0.02, 0.54, 0.75, 0.021,
0.714, 0.234, 0.249, 0.451, 0.662, 0.895, 0.748, 0.001, 0.809,
0.436, 0.006, 0.395, 0.738, 0.459, 0.035, 0.388, 0.56, 0.936,
0.87, 0.93, 0.68, 0.571, 0.232, 0.282, 0.973, 0.831, 0.649, 0.535,
0.759, 0.441, 0.671, 0.109, 0.265, 0.475, 0.711, 0.118, 0.873,
0.286, 0.489, 0.028, 0.785, 0.521, 0.239, 1, 0.696, 0.01, 0.012,
0.028, 0.561, 0.585, 0.393, 0.905, 0, 0.475, 0.177, 0, 0.006,
0.097, 0, 0.415, 0.368, 0, 0.003, 0.152, 0.882, 0.698, 0.18,
0.018, 0.084, 0.072, 0.273, 0.421, 0.178, 0.214, 0.305, 0.855,
0.457, 0.708, 0.593, 0.075, 0.373, 0.745, 0.373, 0.225, 0.596,
0, 0.779, 0.676, 0.779, 0.9, 0.32, 0.738, 0.704, 0.704, 0.374,
0.155, 0.787, 0.644, 0.258, 1, 1, 0.217, 0.72, 0.15, 0.619, 0.565,
0.325, 0.143, 0.101, 0.26, 0.761, 0.611, 0.327, 0.947, 0.121,
0.555, 0.625, 0.367, 0.751, 0.407, 0.113, 0.515, 0.246, 0.782,
0.298, 0.479, 0.399, 0.856)), class = c("grouped_df", "tbl_df",
"tbl", "data.frame"), row.names = c(NA, -144L), groups = structure(list(
column = c("X10", "X11", "X12", "X13", "X14", "X15", "X16",
"X17", "X18", "X19", "X2", "X20", "X21", "X22", "X23", "X24",
"X25", "X26", "X27", "X28", "X29", "X3", "X30", "X4", "X5",
"X6", "X7", "X8", "X9", "Y1", "Y10", "Y11", "Y12", "Y13",
"Y14", "Y15", "Y16", "Y17", "Y18", "Y19", "Y2", "Y20", "Y3",
"Y4", "Y5", "Y6", "Y7", "Y8", "Y9"), .rows = structure(list(
1:3, 4:6, 7:9, 10:12, 13:15, 16:18, 19:21, 22:24, 25:27,
28:30, 31L, 32:34, 35:37, 38:40, 41:43, 44:46, 47:49,
50:52, 53:55, 56:58, 59:61, 62:63, 64:66, 67:69, 70:72,
73:75, 76:78, 79:81, 82:84, 85:87, 88:90, 91:93, 94:96,
97:99, 100:102, 103:105, 106:108, 109:111, 112:114, 115:117,
118:120, 121:123, 124:126, 127:129, 130:132, 133:135,
136:138, 139:141, 142:144), ptype = integer(0), class = c("vctrs_list_of",
"vctrs_vctr", "list"))), row.names = c(NA, -49L), .drop = TRUE, class = c("tbl_df",
"tbl", "data.frame")))
I want to sort it by variable "column" from Y1 to Y20 and then from X smallest to X largest value.
How do I do it ?