Type: | Package |
Title: | Read in Activity Data and Plot Actograms |
Version: | 0.2.3 |
Description: | Read in activity measurements from standard file formats used by circadian rhythm researchers, currently only 'ClockLab' format, and process and plot the data. The central type of plot is the actogram, as first described by in "Activity and distribution of certain wild mice in relation to biotic communities" by MS Johnson (1926) <doi:10.2307/1373575>. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1 |
Suggests: | testthat, covr |
Imports: | dplyr, ggplot2, lubridate, readr, tidyr |
NeedsCompilation: | no |
Packaged: | 2017-10-25 16:33:34 UTC; rcorty |
Author: | Robert Corty [aut, cre] |
Maintainer: | Robert Corty <rcorty@gmail.com> |
Repository: | CRAN |
Date/Publication: | 2017-10-25 17:24:10 UTC |
bin_data
Description
function to bin data time-wise
Usage
bin_data(data, minutes_per_bin)
Arguments
data |
the activity data to bin |
minutes_per_bin |
number of minutes per bin |
Value
the data, after binning
Examples
f <- file.path(system.file(package = 'actogrammr'), 'testdata')
d <- read_clock_lab_files(file_names = list.files(path = f, full.names = TRUE))
b <- bin_data(data = d, minutes_per_bin = 6)
plot_actogram
Description
plots an actogram
Usage
plot_actogram(data, start_date = min(data$date), end_date = max(data$date))
Arguments
data |
the activity data to plot |
start_date |
the start time |
end_date |
the end time |
Value
the plot
Examples
f <- file.path(system.file(package = 'actogrammr'), 'testdata')
d <- read_clock_lab_files(file_names = list.files(path = f, full.names = TRUE))
b <- bin_data(data = d, minutes_per_bin = 6)
## Not run:
plot_actogram(data = b, start_date = '2010-01-01')
## End(Not run)
read_clock_lab_files
Description
reads binary files in clocklab format
Usage
read_clock_lab_files(file_names)
Arguments
file_names |
the names of the files to read. Should be the result of a call to list.files(..., full.names = TRUE) |
Value
a big data.frame
Examples
f <- file.path(system.file(package = 'actogrammr'), 'testdata')
d <- read_clock_lab_files(file_names = list.files(path = f, full.names = TRUE))