Commit e18f10db authored by Weigert, Andreas's avatar Weigert, Andreas
Browse files

Update for T02

parent cd0b2ddf
......@@ -11,6 +11,8 @@ This file is part of the lecture Business Intelligence & Analytics (EESYS-BIA-M)
```{r Exercise: Mathematical calculations}
2 + 3*5^2
2^3^5
1.4e-2
1.4*exp(-2)
......
......@@ -7,9 +7,11 @@ editor_options:
This file is part of the lecture Business Intelligence & Analytics (EESYS-BIA-M), Information Systems and Energy Efficient Systems, University of Bamberg.
# Part Data types
```{r Exercise: Working with lists}
# Execute the code chunks of Tutorial 1 first to have the variables text, u, x, A, etc. loaded into your environment.
# Exercise 27
list_data <- list(text, u, x, A)
......@@ -59,15 +61,16 @@ students[3,2]
students$Age
# Exercise 37
students[students$Age < 30,"Name"] # colum name as identifier
students[students$Age < 30,"Name"] # column name as identifier
students[students$Age < 30,2] # column index as identifier
students[students$Age < 30,]$Name # get a data.frame and then select the variable by $ operator
```
# Your first project: The shower data set
```{r Load and inspect data}
# Task 1 clone git repository
# Task 1 clone / pull the git repository
# Task 2
# Read data. Remember the relative path
......@@ -151,3 +154,18 @@ write.csv2(x = Shower[Shower$Hh_ID != 8899,], file="../../output/cleaned_shower_
After cleaning data we have stored the data to the folder "output".
# Cooldown exercise
```{r Cooldown exercise}
Shower <- read.csv2("../../data/Shower_data.csv")
summary(Shower)
Shower$group <- as.factor(Shower$group)
Shower_one_to_ten <- Shower[Shower$Shower %in% 1:10, ]
tapply(Shower_one_to_ten$Volume, Shower_one_to_ten$group, mean, na.rm=T)
Shower_more_than_ten <- Shower[!Shower$Shower %in% 1:10, ]
tapply(Shower_more_than_ten$Volume, Shower_more_than_ten$group, mean, na.rm=T)
```
......@@ -9,6 +9,8 @@ This file is part of the lecture Business Intelligence & Analytics (EESYS-BIA-M)
```{r Exercise: Working with lists}
# Execute the code chunks of Tutorial 1 first to have the variables text, u, x, A, etc. loaded into your environment.
# Exercise 27
......@@ -114,3 +116,8 @@ Nationality <- as.factor(c("DE","US","DE","SE"))
After cleaning data we have stored the data to the folder "output".
```{r Cooldown exercise}
```
......@@ -6,17 +6,6 @@ editor_options:
---
This file is part of the lecture Business Intelligence & Analytics (EESYS-BIA-M), Information Systems and Energy Efficient Systems, University of Bamberg.
```{r Solution for Cooldown exercise}
Shower <- read.csv2("../../data/Shower_data.csv")
summary(Shower)
Shower$group <- as.factor(Shower$group)
Shower_one_to_ten <- Shower[Shower$Shower %in% 1:10, ]
tapply(Shower_one_to_ten$Volume, Shower_one_to_ten$group, mean, na.rm=T)
Shower_more_than_ten <- Shower[!Shower$Shower %in% 1:10, ]
tapply(Shower_more_than_ten$Volume, Shower_more_than_ten$group, mean, na.rm=T)
```
```{r Functions}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment