-
Notifications
You must be signed in to change notification settings - Fork 2
/
RePro_presentation.Rmd
60 lines (44 loc) · 1.39 KB
/
RePro_presentation.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
---
title: "Example of a presentation made by Rmarkdown"
author: "Morten Rasmussen"
date: "February some day around the 18th - 2019"
output: ioslides_presentation
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = F, message = F)
```
## Import of data
Here we import data. For this slide the code is included, but for the remaning it is silenced
```{r, echo=TRUE}
library(rio)
library(ggplot2)
library(tidyverse)
X <- import('~/Dropbox/Backup/MyDocumentsOnC/Course and teaching/FOOD_Rcourses/BASICs/data/cheese_aromas.xlsx')
```
## A table of data {.build}
```{r}
library(knitr)
library(kableExtra)
df <- head(X[,1:4],20)
kable(df,digits = 1, linesep = '') %>%
kable_styling("condensed", full_width = F, font_size = 8, position = 'float_right') %>%
column_spec(1:2, bold = T) %>%
row_spec(c(7,19), bold = T, color = "white", background = "#D7261E") %>%
row_spec(c(3,20), bold = T, color = "white", background = "blue")
```
## A nice Plot
So a nice vizual is everything Awsome
```{r}
ggplot(data = X, aes(time_culture,`1Butanol`, fill = maturation_culture)) +
geom_boxplot() +
geom_point() +
ylab('Response variable - 1-Butanol') +
theme(axis.title=element_text(size=14))
```
## ANOVA of the aromas
```{r}
# turn of the NA's
options(knitr.kable.NA = '')
mdl <- lm(data = X, `1Butanol` ~ maturation_culture*time_weeks)
kable(anova(mdl), digits = c(0,3,3,1,5))
```