Not long ago, I start to realize that my husband seems snore a lot at night, what’s the worse, it impacts on his breathing system and my sleeping status. In order to take a closer look on how serious his snore situation, I record his snore status by using an Iphone application called SnoreLab.
In this project, I try to analyze five questions as below.
After a week of recording, I collected raw data from SnoreLab. I utilized several functions in ggplot, including geom_jitter,geom_area, geom_point, geom_raster and geom_bar, to visualize data I recorded.
library(ggplot2)
Snore <- read.csv('/Users/ming/Desktop/Final\ Project\ Data\ Set.csv')
ggplot(Snore, aes(x=Bed.Time, y=Quiet.Time)) + geom_jitter(aes(fill=Quiet.Time))
ggplot(Snore, aes(x=Bed.Time, y=Loud.Time)) + geom_area(size=4)
ggplot(Snore, aes(x=Bed.Time, y=Snore.Score)) + geom_point(aes(color=Snore.Score)) + geom_smooth(method = 'lm')
ggplot(Snore, aes(x=Date, y=Snore.Score, z=Bed.Time)) + geom_raster(aes(fill = Bed.Time), hjust=0.5,vjust=0.5,interpolate=FALSE)
ggplot(Snore, aes(x=Quiet.Time, y=Snoring..)) + geom_point(stat="identity")
After read data visualization, I found out that, 1. Quiet time is definitely positive related to Time in Bed; 2. Loud time and Snore Score are negatively related to Time in Bed. 3. There is no certain pattern between Bed.Time, snoring score and Date; 4. Quiet.Time is not the only variable that impacts on snoring % as I see different snoring % under the same Quiet.Time.
Final Dashboard Presenting as below.
ggplot(Snore, aes(x=Bed.Time, y=Loud.Time)) + geom_area(size=4)
ggplot(Snore, aes(x=Bed.Time, y=Snore.Score)) + geom_point(aes(color=Snore.Score)) + geom_smooth(method = 'lm')
ggplot(Snore, aes(x=Date, y=Snore.Score, z=Bed.Time)) + geom_raster(aes(fill = Bed.Time), hjust=0.5,vjust=0.5,interpolate=FALSE)