# Create a data frame that could sensibly be transposed...
Gf <- c(105, 119, 121, 98) # fluid intelligence for 4 people
Gc <- c(110, 115, 119, 103) # crystallised intelligence
Gs <- c(112, 102, 108, 99) # speed of processing
dataset <- data.frame( Gf, Gc, Gs )
rownames(dataset) <- paste( "person", 1:4, sep="" )
print(dataset)
# Gf Gc Gs
# person1 105 110 112
# person2 119 115 102
# person3 121 119 108
# person4 98 103 99
#
# Now transpose it...
tFrame( dataset )
# person1 person2 person3 person4
# Gf 105 119 121 98
# Gc 110 115 119 103
# Gs 112 102 108 99
Run the code above in your browser using DataLab