sleep_health_dataset <- read.csv("sleep_health_dataset.csv")How Lifestyle Habits Affect Sleep Quality and Daily Performance
Introduction
Sleep is really important for our health and how we function every day. But a lot of people don’t get good sleep because of things like stress, too much screen time, long work hours, or drinking caffeine late. When people don’t sleep well they feel tired can’t focus and don’t perform as well during the day. This project is important because it looks at how daily habits affect sleep quality and performance. By using this data we can figure out what helps people sleep better and what makes sleep worse. This can help people make better choices and improve their daily lives.
Project Goal
The purpose of this project is to study how lifestyle and behavioral habits affect sleep quality and daily performance.
Data
We obtained a sleep health dataset from Kaggle (Sleep_Health_Dataset) with 100,000 records. It includes variables related to sleep, lifestyle habits, and performance, such as sleep quality, stress, screen time, and cognitive performance. Each row represents one individual’s daily data.
library(tidyverse)── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr 1.2.1 ✔ readr 2.2.0
✔ forcats 1.0.1 ✔ stringr 1.5.1
✔ ggplot2 3.5.2 ✔ tibble 3.3.0
✔ lubridate 1.9.5 ✔ tidyr 1.3.2
✔ purrr 1.0.4
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(knitr)
data.frame(Variable_Names = names(sleep_health_dataset))%>%
knitr::kable(
caption = "Variable Names in Sleep Health Dataset"
)| Variable_Names |
|---|
| person_id |
| age |
| gender |
| occupation |
| bmi |
| country |
| sleep_duration_hrs |
| sleep_quality_score |
| rem_percentage |
| deep_sleep_percentage |
| sleep_latency_mins |
| wake_episodes_per_night |
| caffeine_mg_before_bed |
| alcohol_units_before_bed |
| screen_time_before_bed_mins |
| exercise_day |
| steps_that_day |
| nap_duration_mins |
| stress_score |
| work_hours_that_day |
| chronotype |
| mental_health_condition |
| heart_rate_resting_bpm |
| sleep_aid_used |
| shift_work |
| room_temperature_celsius |
| weekend_sleep_diff_hrs |
| season |
| day_type |
| cognitive_performance_score |
| sleep_disorder_risk |
| felt_rested |
You can interact with the data using the search box
library(DT)
datatable(sleep_health_dataset)Warning in instance$preRenderHook(instance): It seems your data is too big for
client-side DataTables. You may consider server-side processing:
https://rstudio.github.io/DT/server.html
