# NOT RUN {
# This will make a plot with points and individual lines for each subject's scores
library(lsr)
# we take the Orange built-in data.frame which has a within-subject design
names(Orange) <- c("Tree","age","circ")
# turn the data into a wide format
Orange.wide <- longToWide(Orange, circ ~ age)
# the identifier to each tree must be in a column called id
Orange.wide$id = Orange.wide$Tree
# Makes the plots two different way:
superbPlot( Orange.wide, WSFactors = "age(7)",
variables = c("circ_118","circ_484","circ_664","circ_1004","circ_1231","circ_1372","circ_1582"),
adjustments = list(purpose = "difference", decorrelation = "none"),
plotStyle= "pointindividualline"
)
# if you extract the data with superbData, you can
# run this layout directly
#processedData <- superbData(Orange.wide, WSFactors = "age(7)",
# variables = c("circ_118","circ_484","circ_664","circ_1004","circ_1231","circ_1372","circ_1582"),
# adjustments = list(purpose = "difference", decorrelation = "none"),
#)
#
#superbPlot.pointindividualline(processedData$summaryStatistic,
# "age",
# NULL,
# ".~.",
# processedData$rawData)
# }
Run the code above in your browser using DataLab