Learn R Programming

lmms (version 1.3.3)

plot.lmmspline: Plot of lmmspline object

Description

Plots the raw data, the mean and the fitted or derivative information of the lmmspline object.

Usage

"plot"(x, y, data, time, smooth, mean, ...)

Arguments

x
An object of class lmmspline.
y
character or numeric value. Determining which feature should be plotted can be either the index or the name of the feature.
data
alternative matrix or data.frame containing the original data for visualisation purposes.
time
alternative numeric indicating the sample time point. Vector of same length as row length of data for visualisation purposes.
smooth
an optional logical value. Default FALSE, if TRUE smooth representation of the fitted values.
mean
alternative logical if the mean should be displayed. By default set to TRUE.
...
Additional arguments which are passed to plot.

Value

plot showing raw data, mean profile and fitted profile.

Examples

Run this code
## Not run: 
# data(kidneySimTimeGroup)
# # running for samples in group 1
# G1 <- which(kidneySimTimeGroup$group=="G1")
# testLmmspline <- lmmSpline(data=kidneySimTimeGroup$data[G1,],
#                  time=kidneySimTimeGroup$time[G1],
#                  sampleID=kidneySimTimeGroup$sampleID[G1],keepModels=T)
#                  
#          
# plot(testLmmspline, y=2)
# plot(testLmmspline, y=2, smooth=TRUE)
# # Don't keep the models to improve memory usage 
# testLmmspline <- lmmSpline(data=kidneySimTimeGroup$data[G1,],
#                  time=kidneySimTimeGroup$time[G1],
#                  sampleID=kidneySimTimeGroup$sampleID[G1],keepModels=F)
#                  
# #plot only the fitted values
# plot(testLmmspline, y=2)
# #plot fitted values with original data
# plot(testLmmspline, y=2, data=kidneySimTimeGroup$data[G1,], time=kidneySimTimeGroup$time[G1])
# 
# ## End(Not run)

Run the code above in your browser using DataLab