convert_activity: Convert data for use by the activity package

View source: R/convert.R

convert_activityR Documentation

Convert data for use by the activity package

Description

Converts raw RFID data into a format for easy use by the activity::fitact() function included in the activity package for modelling activity levels and daily activity patterns.

Usage

convert_activity(r)

Arguments

r

Dataframe. Raw RFID dataset. Must have at least columns animal_id, logger_id and time. The column time should be formated as POSIXct (data/time). (Consider using load_format() to format your dataframe)

Value

A list of vectors corresponding to each individual. See examples for specific application.

See Also

activity package and it's function fitact. https://cran.r-project.org/package=activity

Examples


# Format for use by activity package
i <- convert_activity(finches_lg)

## Not run: 
# Use activity package:
library(activity)

# Calculate daily activity pattern for a single individual
a <- fitact(i[[1]], sample = "none")
plot(a)

# Calculate daily activity pattern for all individuals
a <- lapply(i, fitact, sample = "none")
plot(a[[3]])
plot(a[["06200004F8"]])
# etc.

## End(Not run)


animalnexus/feedr documentation built on Feb. 2, 2023, 1:12 a.m.