Title: | Read in Activity Data and Plot Actograms |
---|---|
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>. |
Authors: | Robert Corty [aut, cre] |
Maintainer: | Robert Corty <[email protected]> |
License: | GPL-3 |
Version: | 0.2.3 |
Built: | 2024-11-21 03:50:22 UTC |
Source: | https://github.com/rcorty/actogrammr |
function to bin data time-wise
bin_data(data, minutes_per_bin)
bin_data(data, minutes_per_bin)
data |
the activity data to bin |
minutes_per_bin |
number of minutes per bin |
the data, after binning
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1]) b <- bin_data(data = d, minutes_per_bin = 6)
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1]) b <- bin_data(data = d, minutes_per_bin = 6)
plots an actogram
plot_actogram(data, start_date = min(data$date), end_date = max(data$date))
plot_actogram(data, start_date = min(data$date), end_date = max(data$date))
data |
the activity data to plot |
start_date |
the start time |
end_date |
the end time |
the plot
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1]) b <- bin_data(data = d, minutes_per_bin = 6) ## Not run: plot_actogram(data = b, start_date = '2010-01-01') ## End(Not run)
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1]) b <- bin_data(data = d, minutes_per_bin = 6) ## Not run: plot_actogram(data = b, start_date = '2010-01-01') ## End(Not run)
reads a binary file in clocklab format
read_clock_lab_file(file_name)
read_clock_lab_file(file_name)
file_name |
the name of the file to read, should represent one mouse. Should be the result of a call to list.files(..., full.names = TRUE) |
a big data.frame
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1])
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1])
reads binary files in clocklab format
read_clock_lab_files(file_names)
read_clock_lab_files(file_names)
file_names |
the names of the files to read. Should be the result of a call to list.files(..., full.names = TRUE) |
a big data.frame
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_files(file_names = list.files(path = f, full.names = TRUE))
f <- file.path(system.file(package = 'actogrammr'), 'testdata') d <- read_clock_lab_files(file_names = list.files(path = f, full.names = TRUE))