long2wide.fn | R Documentation |
long2wide.fn: This function transforms a 3-column dataset of frequencies to a square matrix or a contingency table. This function uses the freq.supp.fn() function.
long2wide.fn(freqs.long)
freqs.long |
A 3-column data frame, where the first 2 variables represent the categories that both raters have actually used when classifying the subjects. The third and last variable is generally named "n" and represents the count of subjects that classified into the 2 associated categories by both raters. |
A matrix that represents a contingency showing the distribution of subjects by rater and category.
#The dataset "freqs.data" comes with this package. Analyze it as follows:
long2wide.fn(freqs.data) #Yields a 5x5 matrix
This will produce the following 5x5 matrix:
> long2wide.fn(freqs.data)
a b c d e
a 0 1 0 1 0
b 0 2 0 0 0
c 0 0 3 0 0
d 0 1 0 1 0
e 0 0 0 0 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.