Description Usage Arguments Value Author(s) References Examples
Displays an individual's physical activity pattern of a day during one week.
1 2 3 |
PA |
an N by T matrix including activity counts, where N is the total number of daily profiles, and T is the total minutes of a day (T=1440). |
label |
an N by 2 matrix including the labels corresponding to |
flag |
an N by T matrix with the values of either 1 or 0 which indicating wearing or missing. This matrix can be created from |
time.range |
Define the time range for display. Default is midnight to midnight, which is coded by |
save.plot |
If |
mark.missing |
If |
axis.time |
If TRUE, the x-axis displays the clock times, 8:00, 8:01, 8:02, etc. If FALSE, displays the time index by minute, 481, 482, 483, etc. |
directory.plot |
Directory to save the plots when save.plot=TRUE. If no input, plots are saved to your current directory. |
Plot of activity counts with smoothing curve and missing flag.
Jung Ae Lee <jungaeleeb@gmail.com>
[1] Lee JA, Gill J (2016). Missing value imputation for physical activity data measured by accelerometer. Statistical Methods in Medical Research.
[2] Ramsay, J. O., Wickham, H., Graves, S., and Hooker, G. (2014). fda: Functional Data Analysis. R package version 2.4.3.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | data(acceldata2) ; data=acceldata2 # read data before imputation
data(accelimp) # read data after imputation
# plot 7 days before imputation
accel.plot.7days(PA=data$PA[1:7, ], label=data$label[1:7, ], flag=data$flag[1:7, ],
time.range=c("09:00", "20:59"), save.plot=FALSE)
# plot 7 days after imputation
accel.plot.7days(PA=accelimp[[1]][1:7, ], label=data$label[1:7, ], flag=data$flag[1:7, ],
time.range=c("09:00", "20:59"), save.plot=FALSE)
# save the plot
# setwd("yourfolder") #--- set the directory to save plot when save.plot=TRUE
# accel.plot.7days(PA=accelimp[[1]], label=data$label, flag=data$flag,
# time.range=c("09:00", "20:59"), save.plot=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.