From 6ae9e39278df4708b9f0bd7844ce1c6d485f02e6 Mon Sep 17 00:00:00 2001 From: JustusKilanowski <163479308+JustusKilanowski@users.noreply.github.com> Date: Thu, 16 May 2024 18:09:48 +0200 Subject: [PATCH 1/2] Update PA1_template.Rmd --- PA1_template.Rmd | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/PA1_template.Rmd b/PA1_template.Rmd index d5cc677c93d..13ba18ccb2c 100644 --- a/PA1_template.Rmd +++ b/PA1_template.Rmd @@ -7,17 +7,32 @@ output: ## Loading and preprocessing the data - +wholetable <- read.csv("activity.csv") +wholetable$date <- as.Date(wholetable$date, "%Y-%m-%d") ## What is mean total number of steps taken per day? - - +stepsPerDay <- aggregate(steps ~ date, wholetable, FUN = sum) +g <- ggplot (stepsPerDay, aes (x = steps)) +g + geom_histogram(fill = "blue", binwidth = 1000) + + labs(title = " Steps every day ", x = "Steps", y = "Frequency") +stepsMean <- mean(stepsPerDay$steps, na.rm=TRUE) +stepsMean +## [1] 10766.19 +# Median of steps +stepsMedian <- median(stepsPerDay$steps, na.rm=TRUE) +stepsMedian +## [1] 10765 ## What is the average daily activity pattern? - - - +Intervalsteps <- aggregate(steps ~ interval, wholetable, mean) +h <- ggplot (Intervalsteps, aes(x=interval, y=steps)) +h + geom_line()+ labs(title = " Average Steps per Interval", x = "Interval", y = "Average Steps across All Days") + +maxInterval <- Intervalsteps[which.max(Intervalsteps$steps), ] +maxInterval +## interval steps +## 104 835 206.1698 ## Imputing missing values From 694a9529bb2ee6d4c294daf2f29872d711a7828d Mon Sep 17 00:00:00 2001 From: JustusKilanowski <163479308+JustusKilanowski@users.noreply.github.com> Date: Thu, 16 May 2024 19:26:05 +0200 Subject: [PATCH 2/2] Add files via upload --- PA1_template.Rmd | 65 +++++++++++++++++++----------------------------- 1 file changed, 25 insertions(+), 40 deletions(-) diff --git a/PA1_template.Rmd b/PA1_template.Rmd index 13ba18ccb2c..95688752095 100644 --- a/PA1_template.Rmd +++ b/PA1_template.Rmd @@ -1,40 +1,25 @@ ---- -title: "Reproducible Research: Peer Assessment 1" -output: - html_document: - keep_md: true ---- - - -## Loading and preprocessing the data -wholetable <- read.csv("activity.csv") -wholetable$date <- as.Date(wholetable$date, "%Y-%m-%d") - - -## What is mean total number of steps taken per day? -stepsPerDay <- aggregate(steps ~ date, wholetable, FUN = sum) -g <- ggplot (stepsPerDay, aes (x = steps)) -g + geom_histogram(fill = "blue", binwidth = 1000) + - labs(title = " Steps every day ", x = "Steps", y = "Frequency") -stepsMean <- mean(stepsPerDay$steps, na.rm=TRUE) -stepsMean -## [1] 10766.19 -# Median of steps -stepsMedian <- median(stepsPerDay$steps, na.rm=TRUE) -stepsMedian -## [1] 10765 - -## What is the average daily activity pattern? -Intervalsteps <- aggregate(steps ~ interval, wholetable, mean) -h <- ggplot (Intervalsteps, aes(x=interval, y=steps)) -h + geom_line()+ labs(title = " Average Steps per Interval", x = "Interval", y = "Average Steps across All Days") - -maxInterval <- Intervalsteps[which.max(Intervalsteps$steps), ] -maxInterval -## interval steps -## 104 835 206.1698 -## Imputing missing values - - - -## Are there differences in activity patterns between weekdays and weekends? +--- +title: "Reproducible Research: Peer Assessment 1" +output: + html_document: + keep_md: true +--- + + +## Loading and preprocessing the data +ab + + +## What is mean total number of steps taken per day? + + + +## What is the average daily activity pattern? + + + +## Imputing missing values + + + +## Are there differences in activity patterns between weekdays and weekends?