mrkaye97 / fitbitr Goto Github PK
View Code? Open in Web Editor NEWAn R package for interacting with your Fitbit data
Home Page: http://matthewrkaye.com/fitbitr/
License: GNU General Public License v3.0
An R package for interacting with your Fitbit data
Home Page: http://matthewrkaye.com/fitbitr/
License: GNU General Public License v3.0
Thank you for the awesome package, it makes interfacing with the fitbit very easy.
The fitbit API ( https://dev.fitbit.com/build/reference/web-api/heartrate-timeseries/get-heartrate-timeseries-by-date-range/ )
in addition to HeartRateZone also provides restingHeartRate as a part of the response data.
The get_heart_rate_zones -- which calls the fitbit API above -- does not return restingHeartRate in the dataframe (and also does not return customHeartRateZone which the API also provides).
Please incorporate restingHeartRate into the datastructure returned by get_heart_rate_zones() (which would save on the number of the API calls) or expose it through a different function.
Thanks
1. execute the following
start_date <- lubridate::today() - lubridate::weeks(1)
end_date <- lubridate::today()
get_heart_rate_zones(start_date, end_date)
2. observe no restingHeartRate in the returned data
Hi,
Thank you for creating this package. I have followed the instructions in read me and created the app.
Now, I am doing the following:
library(fitbitr)
generate_token(
client_id = "xxxxx",
client_secret = "xxxxxxxxxxx",
callback = "http://localhost:1410/"
)
But that shows this message:
The app you're trying to connect did not provide valid information to Fitbit. Please report this issue to them.
Could you please guide me where I am making a mistake? Thank you.
I am trying to load a token on a shiny app, but once it times out token refresh does not work as the console must be reached.
Can you make the default to TRUE for do_refresh or at least provide an option to change this to true?
function (reason, error_message)
{
inform(sprintf("%s. Error message: \n\n", reason))
inform(error_message$message)
inform("\n")
do_refresh <- askYesNo("Would you like to generate a new token?",
default = FALSE, prompts = c("y", "n", "c"))
if (do_refresh & !is.na(do_refresh)) {
inform("Trying to generate a new token...")
.fitbitr_token$init_credentials()
}
else {
abort("No token was found, and a new one was not generated.")
}
invisible()
}
In rstudio desktop (windows), the followings works:
generate_token(client_id = "XXXXXXX",
client_secret = "YYYYYYYYYYYYYYYYYYYYYYYYYYYY",
cache = TRUE)
I get Authentication complete. Please close this page and return to R.
in the browser with url of the format http://localhost:1410/?code=XXXXXXXXXXXXXXX&state=YYYYYYYYY#_=_
However in RStudio server (running through docker) gives a "This site can’t be reached. localhost refused to connect." message in the browser.
The RStudio server can use the .httr-oauth generated just fine.
Any ideas? Let me know if you need more info.
Thanks!
I'm having difficulty running any of the intraday functions. For example, when I run
fitbitr::get_heart_rate_intraday()
I get the following error
Error in `dplyr::transmute()`:
In argument: `time = as_datetime(paste(date, .data$time))`.
Caused by error:
! error in evaluating the argument 'x' in selecting a method for function 'as_datetime': Column `time` not found in `.data`.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.