Creates a time-series `scatterplot` of activity counts from an `ActiGlobe` data.frame,marking each midnight boundary with a vertical dashed line and `coloring` points that were flagged (e.g. travel overlaps or unallocated epochs).
Arguments
- df
A data.frame of annotated actigraphy epochs. Must include: - An activity column named by
VAct. - A datetime column named byVTm. - Optionally, a `Note` column to flag affected epochs. SeeBriefSumandTAdjustfor details.- Bdf
A
BriefSumobject containing per-day metadata for the recording. Note, if jet lag occurred during the recording, please, update the metadata usingTAdjustbefore passing to this function.- VAct
Optional character. Name of the activity column in
df. If NULL, defaults to the second column ofdf.- VDT
Optional character. Name of the
POSIXctdatetime column indf.If NULL, defaults to "DateTime" ofdf.
Value
A ggplot object showing:
- Activity counts vs. time.
- Dashed vertical lines at each midnight.
- Points `colored` by whether they were flagged in `Note`.
Examples
if (FALSE) { # \dontrun{
library(ActiGlobe)
# Overview the Uncorrected Longitudinal Recording
data(FlyEast)
BdfList <-
BriefSum(
df = FlyEast,
SR = 1 / 60,
Start = "2017-10-24 13:45:00"
)
p <- ggActiGlobe(
df = BdfList$df,
Bdf = BdfList$Bdf,
VAct = "Activity",
VDT = "DateTime"
)
print(p)
# Overview the Corrected Longitudinal Recording
data(TLog)
BdfList$Bdf.adj <- TAdjust(BdfList$Bdf, TLog)
p2 <- ggActiGlobe(
df = BdfList$df,
Bdf = BdfList$Bdf,
VAct = "Activity",
VDT = "DateTime"
)
print(p2)
# Pro-tip: [`cowplot`] can help stack the time series graphs in one
# single plot
} # }
