get_sleep_logs: Get Sleep Logs

Description Usage Arguments Details Value

View source: R/sleep.R

Description

Returns a summary and list of a user's sleep log entries as well as minute by minute sleep entry data for a given day in the format requested. The response includes summary for all sleep log entries for the given day (including naps.) If you need to fetch data only for the user's main sleep event, you can send the request with isMainSleep=true or use a Time Series call.

Usage

1

Arguments

token

An OAuth 2.0 token

date

The date of records to be returned in the format "yyyy-MM-dd" or "today" as a string or Date object.

Details

The relationship between sleep log entry properties is expressed with the following equation: timeInBed = minutesToFallAsleep + minutesAsleep + minutesAwake + minutesAfterWakeup

Also, values for minuteData can be 1 ("asleep"), 2 ("awake"), or 3 ("really awake").

Value

a list of "sleep" and "summary" data.frame. "sleep" data.frame contains time series information of sleep. "summary" data.frame contains the summary of each "sleep" information.


teramonagi/fitbitr documentation built on Jan. 21, 2021, 8:35 p.m.