You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Histogram of the total number of steps taken each day
data$date<- as.Date(data$date, "%Y-%m-%d")
stepsTotal<- tapply(data$steps, data$date, sum)
hist(stepsTotal, col="blue", xlab="Total Steps per Day", ylab="Frequency",
main="Histogram of the total number of steps taken each day")
3. Mean and median number of steps taken each day
mean(stepsTotal, na.rm=TRUE)
## [1] 10766.19
median(stepsTotal, na.rm=TRUE)
## [1] 10765
4. Time series plot of the average number of steps taken
stepsMean<- tapply(data$steps, data$interval, mean, na.rm=TRUE)
plot(col="blue", row.names(stepsMean), stepsMean, type="l",
xlab="Time Interval", ylab="Mean number of steps taken",
main="Time series plot of the average number of steps taken")
5. The 5-minute interval that, on average, contains the maximum number of steps