install.packages("ggplot2")
## Installing package into '/usr/local/lib/R/site-library'
## (as 'lib' is unspecified)
library(ggplot2)
getwd()
## [1] "/home/rstudio"
#Importing Data
kpe291_data <- read.csv

#create a vector
day1_exercise <- c(60, 66, 120, 60, 30, 45, 180, 120, 30, 90, 90, 90, 0, 60, 60,
                   90, 120, 0, 0, 75, 100, 75, 30, 60, 0, 0, 0, 30, 10, 30, 36, 
                   30, 35, 0, 180, 60, 60, 120, 160, 30, 120, 60, 46, 20, 15, 
                   45, 0, 120, 50, 30, 30, 60, 30, 100, 120, 60, 0, 80, 60, 60, 
                   0, 10, 60, 120, 90, 140, 40, 120, 90, 90, 30, 315, 20, 50, 0, 
                   20, 80, 75, 0, 60, 30, 30, 122, 0, 45, 10, 30, 0, 0, 0, 0, 
                   30, 45, 100, 30, 0, 60, 72, 20, 60, 45, 60, 90, 90, 45, 60, 
                   45, 60, 35, 60, 60, 100, 60, 330, 90, 30, 10, 0, 45, 100, 
                   30, 60, 60, 30, 30, 90, 30, 120, 94, 75, 30, 120, 75, 20, 0, 
                   60, 30, 300, 60, 0, 30, 30, 20, 0, 30, 60, 180, 10, 120, 150, 
                   60, 30, 15, 50, 60, 45, 80, 20, 0, 30, 0, 11, 30, 20, 30, 45,
                   75, 90, 30, 30, 50, 3, 30, 120, 30, 45, 70, 15, 90, 20, 70, 
                   60, 0, 60, 50, 75, 120, 45, 60, 0, 45, 0, 45, 110, 0, 60, 60, 
                   80, 195, 90, 30, 60, 0, 150, 15, 20, 0, 30, 30, 30, 30, 95, 0, 
                   120, 30, 15, 81, 120, 70, 30, 90, 0, 60, 30, 0, 45, 0, 60, 90,
                   105, 90, 30, 45, 0, 30, 30, 90, 177, 90, 0, 60, 30, 45, 95)
data <- data.frame(day1_exercise)
mean(day1_exercise)
## [1] 56.09836
median(day1_exercise)
## [1] 45
quantile(day1_exercise)
##   0%  25%  50%  75% 100% 
##    0   30   45   80  330
#create a vector
day1_social_media <- c(80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 80, 
                       80, 80, 80, 80, 80, 80, 180, 40, 90, 245, 300, 0, 60,
                       120, 10, 20, 77, 90, 95, 79, 120, 167, 171, 80, 240, 
                       120, 487, 76, 233, 80, 311, 250, 196, 180, 120, 90,
                       233, 240, 90, 58, 180, 226, 120, 60, 280, 73, 270, 0, 
                       90, 150, 235, 100, 52, 100, 45, 65, 100, 10, 360, 103, 
                       45, 120, 74, 100, 417, 278, 212, 80, 120, 210, 150, 180, 
                       309, 120, 162, 60, 270, 70, 40, 179, 120, 180, 180, 180, 
                       138, 180, 138, 452, 240, 181, 120, 120, 60, 75, 120, 180, 
                       300, 60, 267, 289, 90, 120, 120, 265, 80, 59, 240, 300, 
                       120, 120, 40, 87, 20, 139, 189, 180, 240, 290, 209, 150, 
                       180, 120, 120, 180, 75, 200, 246, 300, 60, 252, 210, 5,
                       109, 150, 215, 45, 365, 180, 100, 25, 75, 179, 120, 180,
                       300, 120, 0, 792, 133, 360, 199, 420, 190, 241, 120, 240, 
                       180, 66, 211, 247, 438, 60, 198, 20, 90, 180, 40, 328,
                       120, 60, 402, 300, 180, 220, 240, 548, 203, 345, 3, 180, 
                       180, 120, 45, 200, 128, 240, 600, 161, 110, 70, 123, 22, 
                       2, 180, 120, 300, 262, 180, 180, 180, 300, 408, 44, 180,
                       180, 240, 60, 240, 120, 120, 141, 90, 180, 126, 300, 210,
                       148, 104, 217, 60, 180, 300, 90, 37, 120, 128, 180, 90, 
                       85, 210.)

data <- data.frame(day1_social_media)

Plot <- ggplot(data, aes(x = day1_social_media)) + geom_histogram(binwidth = 10)

histogram <- ggplot(data) + aes(x = day1_social_media) + geom_histogram()
histogram
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

histogram <- ggplot(data) + aes(x = day1_social_media) + geom_histogram(colour="black", fill="red") + theme_bw()
histogram
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

histogram <- ggplot(data) + aes(x = day1_social_media) + 
  geom_histogram(colour="black", fill="red") + theme_bw() +ggtitle ("Time on Social Media") + xlab("Minutes") + ylab("People")
histogram
## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.