Package {actisensorlog}


Type: Package
Title: Summarize 'SensorLog'/'SensorLogger' Activity Data
Version: 0.3.0
Description: Provides functions for analyzing 'SensorLog' https://sensorlog.berndthomas.net/ and 'SensorLogger' https://www.tszheichoi.com/sensorlogger data.
License: GPL-3
Depends: R (≥ 4.1.0)
Suggests: testthat (≥ 3.0.0), covr, knitr, rmarkdown
Encoding: UTF-8
Imports: actibase (≥ 0.8.0), actiread, assertthat, dplyr, geosphere, janitor, lubridate, lutz, tidyr
Config/roxygen2/version: 8.1.1
URL: https://github.com/jhuwit/actisensorlog, https://jhuwit.github.io/actisensorlog/
BugReports: https://github.com/jhuwit/actisensorlog/issues
Config/testthat/edition: 3
NeedsCompilation: no
Packaged: 2026-10-22 01:49:54 UTC; johnmuschelli
Author: John Muschelli ORCID iD [aut, cre]
Maintainer: John Muschelli <muschellij2@gmail.com>
Repository: CRAN
Date/Publication: 2026-10-22 02:40:02 UTC

Process SensorLog Data

Description

Process SensorLog Data

Usage

acti_process_sensorlog(
  data,
  lat = NULL,
  lon = NULL,
  dist_fun = geosphere::distVincentyEllipsoid,
  expected_timezone = NULL,
  check_data = TRUE,
  remove_cols = c("file", "index"),
  verbose = TRUE,
  ...,
  distance_cutoff = 180
)

acti_check_duplicate_times(data, remove_cols = c("file", "index"))

acti_calculate_distance(
  data,
  lat,
  lon,
  distance_cutoff = 180,
  dist_fun = geosphere::distVincentyEllipsoid,
  fast = TRUE
)

Arguments

data

A SensorLog-style data.frame

lat

Latitude of central point (e.g. home) to calculate distance. Set to NULL if distance should not be calculated.

lon

Longitude of central point (e.g. home) to calculate distance Set to NULL if distance should not be calculated.

dist_fun

Distance function to pass to geosphere::distm

expected_timezone

Expected Timezone based on the latitude/longitude of the data based on the lat/lon values from SensorLog ( e.g. "America/New_York"). Set to NULL if not to be checked.

check_data

should acti_check_duplicate_times be run?

remove_cols

columns to remove from duplicate checking in acti_check_duplicate_times. Default is c("file", "index")

verbose

print diagnostic messages. Either logical or integer, where higher values are higher levels of verbosity.

...

additional arguments to pass to acti_sensorlog_process_time, including apply_tz and tz

distance_cutoff

Distance in meters to consider within home, in meters

fast

Calculate distance on the distinct latitude/longitude, not the full data. Should be used unless some precision looks wrong.

Value

A data.frame of transformed data

Note

This calls acti_check_duplicate_times, acti_calculate_distance, and acti_sensorlog_process_time

Examples

sensorlog = suppressMessages(
  actiread::acti_read_sensorlog(actiread::acti_example_sensorlog_file())
)
sensorlog = dplyr::distinct(sensorlog, time, .keep_all = TRUE)
result = acti_process_sensorlog(
  sensorlog,
  lat = 39.3,
  lon = -76.6,
  expected_timezone = "America/New_York",
  check_data = FALSE
)
head(result)
minute = acti_minute_sensorlog(result)
summary = acti_summarize_sensorlog(result)


Process the Time data from SensorLog and Compare to an Expected Timezone

Description

Process the Time data from SensorLog and Compare to an Expected Timezone

Usage

acti_sensorlog_process_time(
  data,
  expected_timezone = "America/New_York",
  tz = "GMT",
  apply_tz = TRUE,
  check_data = TRUE,
  verbose = TRUE,
  ...
)

Arguments

data

A SensorLog-style data.frame

expected_timezone

Expected Timezone based on the latitude/longitude of the data based on the lat/lon values from SensorLog ( e.g. "America/New_York"). Set to NULL if not to be checked.

tz

timezone to project the data into. Keeping as GMT and should have same value for apply_tz to agree (caution: always check data) with ActiGraph, passed to lubridate::as_datetime.

apply_tz

Apply the timezone from the timezone shift from the timezone, e.g. "2025-03-11T14:44:11-04:00" becomes "2025-03-11T18:44:11" if apply_tz = TRUE, but "2025-03-11T14:44:11" if apply_tz = FALSE.

check_data

if TRUE any duplicates for time are checked for.

verbose

print diagnostic messages. Either logical or integer, where higher values are higher levels of verbosity.

...

additional arguments to pass to lutz::tz_lookup_coords()

Value

A data.frame


Summarize SensorLog Data

Description

Summarize SensorLog Data

Usage

acti_summarize_sensorlog(data)

acti_summarise_sensorlog(data)

acti_minute_sensorlog(data, seconds = 60L)

acti_summarize_distance_sensorlog(data)

Arguments

data

A SensorLog-style data.frame, usually output from acti_process_sensorlog

seconds

number of seconds to summarize the data for the "minute" level, or a string such as "1 min" (see actibase::acti_standardize_epoch()). Usually 1 minute/60 seconds. For acti_summarize_distance_sensorlog, summarization is done depending on how the data is grouped.

Value

The data.frame with the summarized data for each date


Objects exported from other packages

Description

These objects are imported from other packages. Follow the links below to see their documentation.

actiread

acti_convert_sensorlogger_time(), acti_example_sensorlog_file(), acti_example_sensorlogger_file(), acti_example_sensorlogger_location_file(), acti_read_sensorlog(), acti_read_sensorlogger(), acti_read_sensorlogger_general(), acti_read_sensorlogger_location(), acti_rewrite_sensorlog_csv(), acti_sensorlog_csv_colnames_mapping(), acti_sensorlog_csv_spec(), acti_sensorlogger_location_colnames_mapping(), acti_sensorlogger_location_spec()