Created
October 3, 2021 14:11
-
-
Save vnegi10/7874f41404c7e06130e90c60c33d6aa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub link | |
const URL = "https://raw.githubusercontent.com/vnegi10/Health_data_analysis/master/data" | |
# CSV files from Samsung Health app | |
files = ["com.samsung.shealth.tracker.pedometer_day_summary.202110031456.csv", | |
"com.samsung.shealth.tracker.heart_rate.202110031456.csv", | |
"com.samsung.health.floors_climbed.202110031456.csv"] | |
# Function to generate url | |
gen_url(file::String, url::String=URL) = joinpath(url, file) | |
# Function to convert url to DataFrame | |
url_to_df(url::String) = CSV.File(HTTP.get(url, require_ssl_verification = false).body, header = 2) |> DataFrame | |
df_pedometer_raw, df_heart_raw, df_floors_raw = [url_to_df(gen_url(file)) for file in files] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment