get_nrows {mpathsenser}R Documentation

Get the number of rows per sensor in a mpathsenser database

Description

[Stable]

Usage

get_nrows(
  db,
  sensor = "All",
  participant_id = NULL,
  start_date = NULL,
  end_date = NULL
)

Arguments

db

db A database connection, as created by create_db().

sensor

A character vector of one or multiple vectors. Use sensor = "All" for all sensors. See sensors for a list of all available sensors.

participant_id

A character string identifying a single participant. Use get_participants() to retrieve all participants from the database. Leave empty to get data for all participants.

start_date

Optional search window specifying date where to begin search. Must be convertible to date using base::as.Date(). Use first_date() to find the date of the first entry for a participant.

end_date

Optional search window specifying date where to end search. Must be convertible to date using base::as.Date(). Use last_date() to find the date of the last entry for a participant.

Value

A named vector containing the number of rows for each sensor.

Examples

## Not run: 
# Open a database connection
db <- open_db("path/to/db")

# Get the number of rows for all sensors
get_nrows(db, sensor = NULL)

# Get the number of rows for the Accelerometer and Gyroscope sensors
get_nrows(db, c("Accelerometer", "Gyroscope"))

# Remember to close the connection
close_db(db)

## End(Not run)

[Package mpathsenser version 1.2.3 Index]