matrix2long | R Documentation |
This function converts data from a quadratic round robin matrix into long format.
matrix2long(M, new.ids=TRUE, var.id="value")
M |
A matrix with actors in rows and partners in columns) |
new.ids |
Should new ids for actors and partners be defined? (If new.ids=FALSE the row and column names are taken. In that case, you have to make sure, that rows and columns have the same set of names.) |
var.id |
The name of the column with the measured variable in the returned data frame |
A data frame in long format
long2matrix
#The example data are taken from the "Mainz Freshman Study" and consist # of ratings of liking as well as ratings of the metaperception of # liking at zero-acquaintance using a Round-Robin group of 54 participants # (Back, Schmukle, & Egloff, in pres) # load a data set in matrix style data("liking_a") str(liking_a) long <- matrix2long(liking_a) str(long)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.