Package 'actogrammr'

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

Help Index


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_file(file_name = list.files(path = f, full.names = TRUE)[1])
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_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)

read_clock_lab_file

Description

reads a binary file in clocklab format

Usage

read_clock_lab_file(file_name)

Arguments

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)

Value

a big data.frame

Examples

f <- file.path(system.file(package = 'actogrammr'), 'testdata')
d <- read_clock_lab_file(file_name = list.files(path = f, full.names = TRUE)[1])

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))