I am working with long format dataframes and intend to write a package myself. While it is not crucial, i would like to adhere to common practice of column hierarchy, e.g. when I have 3 participants and two sessions for each participant, the column denoting the session would be seen as having a higher position in the hierarchy.
It seems to be standard that the value is to the very right. However, for the identifier-columns, it is not clear if the column with the highest position should be to the very left or almost very right, i.e. I could make it be session, participant, value or participant, session, value. Intuitive for me would be the former and ChatGPT also told me so, but reshape2::melt() uses the latter order, when converting a multidimensional array into a dataframe, as it puts the highest dimension to the right instead of to the left.
data.frame(session = rep(1:2, each = 3), participant = 1:3, value = sample(6)/100)
data.frame(participant = 1:3, session = rep(1:2, each = 3), value = sample(6)/100)
FelixSchweigkofler is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.