Data is on kaggle, link FitBit Fitness Tracker Data | Kaggle
These are the steps i did:
list.files(path = "/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16")
sleep <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/sleepDay_merged.csv", header = T)
intensity <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/dailyIntensities_merged.csv",header = T)
activity <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/dailyActivity_merged.csv",header = T)
steps <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/dailySteps_merged.csv",header = T)
calories <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/dailyCalories_merged.csv",header = T)
weight <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/weightLogInfo_merged.csv",header = T)
sleep %>% group_by(Id,SleepDay) %>% count() %>% View()
sleep$Id <- as.character(sleep$Id)
sleep <- sleep %>% unique()
colnames(activity)[2] <- "ActivityDay"
activity$Id <- as.character(activity$Id)
sleep$Id <- as.character(sleep$Id)
sleep$ActivityDay <- substring(sleep$SleepDay,1,9)
daily <- left_join(activity,sleep)
weight$Id <- as.character(weight$Id)
weight$ActivityDay <- substring(weight$Date,1,9)
daily <- left_join(daily, weight)
daily <- daily %>% select(-c(Date,SleepDay))
daily$QualitySleep <- daily$TotalMinutesAsleep / daily$TotalTimeInBed * 100
calories <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/hourlyCalories_merged.csv", header = T)
intensities <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/hourlyIntensities_merged.csv", header = T)
steps <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/hourlySteps_merged.csv", header = T)
hourly <- left_join(calories,intensities)
hourly <- left_join(hourly,steps)
calories_narrow <- read.csv( "/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/minuteCaloriesNarrow_merged.csv", header = T)
intensities_narrow <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/minuteIntensitiesNarrow_merged.csv", header = T)
steps_narrow <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/minuteStepsNarrow_merged.csv", header = T)
sleep <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/minuteSleep_merged.csv", header = T)
met <- read.csv("/kaggle/input/fitbit/Fitabase Data 4.12.16-5.12.16/minuteMETsNarrow_merged.csv", header = T)
minute <- left_join(calories_narrow,intensities_narrow)
minute <- left_join(minute,steps_narrow)
minute <- left_join(minute,met)
rm(calories_narrow,intensities_narrow,steps_narrow,met)
sleep %>% group_by(Id,ActivityMinute) %>% count() %>% View()
I am stuck here