Commit ab216080 authored by de Freitas Costa, Eduardo's avatar de Freitas Costa, Eduardo
Browse files

Implementation with veal calves

parent a585733d
......@@ -2,9 +2,13 @@
.Rhistory
.RData
.Ruserdata
Data/
Data/README_DataManagementPlan.txt
Data/Raw/
Data/Processed/
Documents/
Figures/
ref and inputs/
Literature/
Output/
Validation/
*.Rproj
*.docx
######################################
#Creating objects and parameters #
######################################
#Creating objects which R will store the information or parameters
H<-numeric()
C<-numeric()
VC<-numeric()
Tr<-numeric()
D<-numeric()
Fa<-numeric()
Fa1<-numeric()
flock<-list()
batch<-list()
time_flock<-list()
time_batch<-list()
amu<-list()
amu1<-list()
media_H<-numeric()
media_H2<-numeric()
media_C<-numeric()
media_C2<-numeric()
media_F<-numeric()
media_F1<-numeric()
media_F2<-numeric()
media_F3<-numeric()
media_VC<-numeric()
media_VC1<-numeric()
r1<-numeric()
r2<-numeric()
r2.1<-numeric()
r3<-numeric()
r3.1<-numeric()
r4<-numeric()
r4.1<-numeric()
r5<-numeric()
r6<-numeric()
r6.1<-numeric()
r6.2<-numeric()
r6.3<-numeric()
r7<-numeric()
r7.1<-numeric()
r8<-numeric()
r8.1<-numeric()
r9<-list()
ere9<-numeric()
r10<-list()
ere10<-numeric()
ere9.1<-numeric()
ere10.1<-numeric()
r11<-list()
r12<-list()
r13<-list()
r14<-list()
r14<-list()
p<-numeric()
p1<-numeric()
p2<-numeric()
p3<-numeric()
p4<-numeric()
p3.1<-numeric()
p4.1<-numeric()
p5<-list()
p6<-list()
p7<-list()
p8<-list()
media<-numeric()
media1<-numeric()
Nenv1<-numeric()
Next1<-numeric()
Nenv2<-numeric()
Next2<-numeric()
Nenv3<-numeric()
Next3<-numeric()
Nenv4<-numeric()
Next4<-numeric()
Nenv5<-numeric()
Next5<-numeric()
Nenv_beef1<-numeric()
Next_beef1<-numeric()
Next_beef5<-numeric()
a<-numeric()
a1<-numeric()
prev_slaug<-numeric()
prev_slaug_beef<-numeric()
prev_cons<-numeric()
prev_chi<-numeric()
prev_beef<-numeric()
prev_veg<-numeric()
prev_veg1<-numeric()
raw<-numeric()
raw1<-numeric()
raw_af<-numeric()
raw_af1<-numeric()
raw_cross<-numeric()
raw_cross1<-numeric()
veg_cross<-numeric()
veg_cross1<-numeric()
ready<-numeric()
ready1<-numeric()
ready2<-numeric()
ready2.1<-numeric()
dose_chi<-numeric()
dose_beef<-numeric()
dose_veg<-numeric()
dose_veg1<-numeric()
#Infection dynamics in Open commmunity
prev1<-0.05 #prev in human time zero
col_proc<- c(1/27,1/27,1/27,1/27,1/27,1/27,1/27,1/27,
1/57,1/12,1/27,1/27,1/27,1/27,1/27,1/27,
1/27,1/27,1/27,1/27,1/27,1/27) #rate of within-household colonization (week) Haverkate et al. (2017)
fade_h<-c(1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,
1/16,1/31,1/8,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16) # Rate of colonization cleareance in healthy people Haverkate et al. (2017)
expo_fa<-c(0.001133,0,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133
,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133,0.001133) #Proportion of humans in open comunity which have contact with BF farmers Mughini-Gras et al. (2019)
expo_fa1<-c(0.002319,0,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319
,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319,0.002319) #Proportion of humans in open comunity which have contact with VC farmers Mughini-Gras et al. (2019)
#Farm exposure is proportional to the number of farms 500 for chicken and 1000 for veal. see (https://www.statista.com/statistics/647188/total-number-of-veal-calves-in-the-netherlands/)
consu_ch<-34.5 #Chicken consumption per capta in grams/portion https://www.wateetnederland.nl/resultaten/voedingsmiddelen/consumptie/vlees (35% Dutch production)
consu_beef<-26.46 #Beef consumption per capta in grams/portion https://www.wateetnederland.nl/resultaten/voedingsmiddelen/consumptie/vlees (35% Dutch production)
consu_veg<-600 #Vegetables consumption per capta in grams/portion https://www.wateetnederland.nl/resultaten/voedingsmiddelen/consumptie/groenten
non_veg<-0.955 #Frequency of non-vegetarians in NL #RIVM 2017
prob_consu<-c(1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) #Weekly consumption of 1 portion of chicken in NL #RIVM 2017
prob_consu_beef<-c(1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1) #Weekly consumption of 1 portion of beef in NL #RIVM 2017
alfa<-713 #Evers
gama<-0.267 #Evers
#Infection dynamics in farmers community
prev2<-0.05 #prev in chicken farmers time zero
rate1<-c(0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25,0.25
,0.2,0.3,0.25,0.25,0.25,0.25,0.25,0.25) #Prob of colonization of farmer given contact with a flock Huijbers 2014
col_proc2<- 1-exp(-1/27) #Colonization given the contact with open community Haverkate et al. (2017)
fade_fa<-c(1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,
1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16,1/16) #average time (week) to colonization cleareance in healthy people Haverkate et al. (2017)
prev2.1<-0.05 #prev in veal farmers time zero
rate1.1<-c(0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1
,0.05,0.2,0.1,0.1,0.1,0.1,0.1,0.1) #Prob of colonization of farmer given contact with calves
col_proc2.1<- 1-exp(-1/27) #Colonization given the contact with open community
fade_fa1<-c(16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16)^-1
#Infection dynamics in farm animals
prev3<-0.01 #prev in chicken time zero
prev4<-0.25 #prev in vc time zero
beta_ch<-c(1.0, 1.0, 0.8, 1.0, 1.0, 1.0, 1.0,1.0,1.0,1.0,1.0,
1.0, 0.8, 2 ,1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) #Beta direct flocks Dama-Koerevaar et al. thesis pg. 86. parameter value guess to fit the model
beta_vc<-c(0.113, 0.113, 0.12, 0.113, 0.113, 0.113, 0.113,0.113,0.113,0.113,0.113,
0.113,0.1,0.113,0.113,0.113, 0.113, 0.113, 0.113,0.113,0.113,0.113) #Beta rate (calves/week) direct vc longitudinal vc study
fade_ch<-c(0.95,0.95,1,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95,
0.95,0.95,0.95,0.95,0.95,0.95,0.95,0.95) #rate (ch/weeks) of decolonization. Value guess to fit the model
fade_vc<-c(0.077,0.077,0.53,0.077,0.077,0.077,0.077,0.077,0.077,0.077,0.077,0.077,0.077,0.077,
0.077,0.077,0.077,0.077,0.077,0.077,0.077,0.077) #rate (calves/week) of decolonization longitudinal vc study
rate2<-c(0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.001,0.02,0.01,0.01,0.01,0.01) #Prob of colonization of a chiken given the contact with a farmer Guess
rate3<-c(0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.01,0.2,0.1,0.1,0.1,0.1) #Prob of colonization of a calve given the contact with a farmer: Guess
#rate4<-c(0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.01,0.2,0.1,0.1,0.1,0.1) #Prob of colonization of a calve given the contact with OC: Guess
heavy_prop<-c(0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,
0.01,0.001,0.1,0.01,0.01) #proportion of heavy ATM flocks No data, scenario created based on Luiken et al. (2019)
heavy_prop1<-c(0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.1,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01,
0.01,0.001,0.1,0.01,0.01) #proportion of heavy ATM veal farms No data, scenario created based on Luiken et al. (2019)
heavy_b<-c(1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.02,5.2) #effect of high ATU on the beta_ch Luiken et al. (2019)
heavy_f<-c(0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.6
,0.6,0.6,0.6,0.6,0.6,0.6,0.6,0.9,0.1) #effect of high ATU on the fade_ch Luiken et al. (2019)
heavy1<-c(1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.72,1.52,1.93)^-1 #effect of high ATU on the fade_vc longitudinal VC study
##Chicken slaughter parameters
#Scalding paramenters
aext1<-0.053 # tranfer from carcass to environ during scalding
cext1<-0.18 # inactivation/removal from carcass surface during scalding https://browser.combase.cc/ComBase_Predictor.aspx?model=2 & Pacholewicz et al. 2016
benv1<-c(1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5,1.1*10^-5) # transfer from envir to carcass surface during scalding
cenv1<-0.98 # inactivation from environ during scalding https://browser.combase.cc/ComBase_Predictor.aspx?model=2 & Pacholewicz et al. 2016
afec1<-1-(1.4*10^-6) # 1- probability of 1 CFU from the faeces to the carcass
pfec1<-c(0.03,0.03,0.03,0.03,0.03,0.03,0.1,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03) # probability of fecal leakage during scalding Pacholewicz et al. 2016
wfec1<-c(1.3,1.3,1.3,1.3,1.3,1.3,2,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3,1.3) # amount of feces that leakes from a carfcass (grams) during scalding Nauta et al. (2005)
sig_wfec1<-0.38 # SD amount of feces that leakes from a carfcass (grams) during scalding Nauta et al. (2005)
conc1<-5.68 # concentration o ESBL in feces log10(CFU/gram) Ceccarelli et al. (2017)
sig_conc1<-0.67 # SD concentration o ESBL in feces log10(CFU/gram) Ceccarelli et al. (2017)
#carcass weight in grams
car_me<-1.190*1000 # Pacholewicz et al. 2016
car_sd<-0.02*1000
##Veal calves slaughter parameters
#Skinning paramenters
aext_beef1<-0.65 # tranfer from carcass to environ during skinning
cext_beef1<-0 # inactivation/removal from carcass surface during skinning
benv_beef1<-c(0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02,0.02) # transfer from envir to carcass surface during skinning
cenv_beef1<-0.98 # inactivation from environ during skinning
afec_beef1<-1-(10^-7) # 1- probability of fecal contamination during skinning
pfec_beef1<-c(0.03,0.03,0.03,0.03,0.03,0.03,0.1,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03,0.03) # probability of fecal leakage during skinning
wfec_beef1<-c(4.3,4.3,4.3,4.3,4.3,4.3,5,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3,4.3) # amount of feces that leakes from a carfcass (grams) during skkining
sig_wfec_beef1<-0.38 # SD amount of feces that leakes from a carfcass (grams) during skkining
conc_beef1<-5.68 # concentration o ESBL in feces log10(CFU/gram)
sig_conc_beef1<-0.67 # SD concentration o ESBL in feces log10(CFU/gram)
car_beef_me<-1.190*1000
car_beef_sd<-0.02*1000
#bacterial growth at consumer phase parameters
tgen_min<-0.47 # min generation time cited by Evers et al. (2016)
Tmin<-6 # min temperature growth cited by Evers et al. (2016)
Topt<-37.5 # Optimum growth temperature cited by Evers et al. (2016)
Tst<-5.99 #Temperature storage in fridge in celcius for meat to be cooked Evers et al. (2016)
tst<-c(3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024,3024) #Time storage in minutes at fridge temperature for meat to be cooked Evers et al. (2016)
#bacterial cross-contamination parameters at consumer
cross<-c(1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3,1.5e-3) # Fraction of bacteria tranfer to salad Evers et al. (2016)
frac_cross<-c(0.47,0.47,0.47,0.47,0,1,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47,0.47) #Fraction of meals prepared chicken + vegetables
##bacterial inactivation at consume phase paramenters
#Chicken
Tend<-71.5 # Final heating temp Evers et al. (2016)
Tref<-70 # Temp reference for D value Evers et al. (2016)
the<-15 # time cooking (minutes) Evers et al. (2016)
Dref<-(-0.67) # log Time variation (minutes) to decrease the E. coli in 90% at 70 C Evers et al. (2016)
z<- 10.6 # Temp variation to decrease D value in 90% Evers et al. (2016)
Dvalue<-10^(Dref-(Tend-Tref)/z)
#Beef
Tend1<-61.5 # Final heating temp Evers et al. (2016)
the1<-5 # time cooking (minutes) Evers et al. (2016)
Dvalue1<-10^(Dref-(Tend1-Tref)/z)
### Multidirectional dynamic source attribution ESBL
Main objective of the project is to model a multidirectinal dynamic mechanistic source attribution for ESBL. A risk assessment approach is used to answer the following questions:
+ i) Estimate the number of human ESBL colonization attributed to the livestock sector;
+ ii) Interventions in the food chain (here: chicken consumption), and in which step interventions contribute most to reducing the number of human colonization;
+ iii) Contribution of broiler flock farms with high antimicrobial usage to the public health burden of ESBL colonization.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
library(ggplot2)
library(tidyverse)
# Final risk/week
risk <- read.csv("C:/Users/defr001/OneDrive - WageningenUR/MADRA2/Output/chicken_risk/scenario1/data1.txt", sep="")
1-((1-risk$r1[dim(risk)[1]])*(1-risk$r2[dim(risk)[1]])*(1-risk$r3[dim(risk)[1]])*(1-risk$r4[dim(risk)[1]]))
1-((1-risk$r6[dim(risk)[1]])*(1-risk$r6.1[dim(risk)[1]])*(1-risk$r7[dim(risk)[1]])*(1-risk$r3[dim(risk)[1]])*(1-risk$r4[dim(risk)[1]]))
1-((1-risk$ere9[dim(risk)[1]])*(1-risk$ere10[dim(risk)[1]]))
rbind(
cbind(tail(risk$r1,n=1),tail(risk$r2,n=1),"NA",tail(risk$r3,n=1),tail(risk$r4,n=1)),
cbind(tail(risk$r6,n=1),tail(risk$r6.1,n=1),tail(risk$r7,n=1),tail(risk$r3,n=1),tail(risk$r4,n=1)),
cbind("NA",tail(risk$ere10,n=1),tail(risk$ere9,n=1),"NA","NA")
)
#Final colonization week 200
colo <- read.csv("C:/Users/defr001/OneDrive - WageningenUR/MADRA2/Output/chicken/scenario1/data1.txt", sep="")
colo1.2<- gather(colo,key="pop",value="prop")
colo1.2$time<-rep(seq(1,200,1),4)
colo2<-subset(colo1.2,pop %in% c("H","media","Fa"))
colo2$pop<-as.factor(colo2$pop)
ggplot(colo2, aes(x=time, y=prop, linetype=pop)) +
geom_line(size=1.01)+
ylab("Prevalence")+
xlab("Time (weeks)")+
theme_minimal()+
theme(legend.position="bottom",legend.title=element_blank(),
axis.text.x = element_text(colour = 'black',
size = 20),
axis.text.y = element_text(colour = 'black',
size = 20),
axis.title.x = element_text(size = 20),
axis.title.y = element_text(size = 20))+
theme(legend.text=element_text(size=15), legend.spacing.x = unit(0.5, 'cm'),
legend.key.height= unit(1, 'cm'),
legend.key.width= unit(1.3, 'cm'))+
scale_y_continuous(labels = function(x) paste0(x*100, "%"),breaks = seq(0,0.35,0.05))+
scale_linetype_manual(values=c(1, 2, 3),breaks =c("Fa", "H", "media") ,
labels=c("Farmers", "Open community", "Flocks"),element_text(size=10))
# Data gathering for tornados
cena <- readRDS("C:/Users/defr001/OneDrive - WageningenUR/MADRA2/Output/chicken/cena.rds")
nome2<-nome1[2:8]
nome3<-nome1[c(9:18,21:simtable)]
nome4<-nome1[17:simtable]
dado1<-cbind.data.frame(cena[2:8],nome2)
dado2<-cbind.data.frame(cena[c(9:18,21:simtable)],nome3)
dado3<-cbind.data.frame(cena[17:simtable],nome4)
# Scenarios for humans
teste<-cbind.data.frame(logdiff=log(dado1$`cena[2:8]`/base),name=dado1$nome2)
ggplot(teste,aes(y=logdiff,x=reorder(name, abs(logdiff))))+
geom_bar(stat = "identity")+
ylab("Log difference")+
theme_minimal()+
theme(text = element_text(size=15))+
xlab(" ")+
coord_flip()
# Uncertianty for humans
teste2<-cbind.data.frame(logdiff=log(dado2$`cena[c(9:18, 21:simtable)]`/base),name=dado2$nome3)
ggplot(teste2,aes(y=logdiff,x=reorder(name, abs(logdiff))))+
geom_bar(stat = "identity")+
ylab("Log difference")+
theme_minimal()+
theme(text = element_text(size=15))+
xlab(" ")+
coord_flip()
\ No newline at end of file
This diff is collapsed.
---
title: "Summary report for dairy farms"
author: "Eduardo de Freitas Costa"
date: '`r format(Sys.Date(), "%Y-%m-%d")`'
output:
html_document:
df_print: paged
code_folding: hide
toc: yes
toc_depth: 3
---
```{r}
#header #################################################################################
#'veal_calves.R'
#Title: title
#Project ID: pid
#Client: client
#Author: <Eduardo> <Costa>, Wageningen Bioveterinary Research
#Description: description
#Start date: date
#Last Update: {6:date}
#R version: r.version
#Scriptversion: version
#Dependencies
#<-Downstream
#->Upstream
#Input:
#-
#Output:
#-
#Peer reviewer(s)
#Please ensure directories are relative. Please comment code sufficiently.
#Script start#############################################################################
```
```{r setup, include=FALSE}
# Library and source statements ###############################################
rm(list = ls())
#Packages to be used
packages<-c("readxl","here","tidyverse","ggplot2","lme4","logistf","car","knitr","glmmsr","plotly","gridExtra","grid","ggridges","ggthemes","glmmTMB",
"bbmle","multcomp","multcompView","lsmeans","lattice")
# Install packages not yet installed
installed_packages <- packages %in% rownames(installed.packages())
if (any(installed_packages == FALSE)) {
install.packages(packages[!installed_packages])
}
# Packages loading
invisible(lapply(packages, library, character.only = TRUE))
# Create folders ##############################################################
dir.create(here("Figures"))
dir.create(here("Outputs"))
# Define knitr options ########################################################
# global options
knitr::opts_chunk$set(message = FALSE) # code default outputs
knitr::opts_chunk$set(warning = FALSE) # code warnings
knitr::opts_chunk$set(echo = TRUE) # code chunks show
```
```{r}
#Importing data form veal calve studies
veal<-rbind(
read_excel(here("Data","Raw","veal_calves.xlsx"),sheet = "TRNS")
)
colnames(veal)[8]<-"output"
veal<-subset(veal,`Maldi-TOF` %in% c(0,1)) #Only E. coli
```
#Descriptives
```{r}
jpeg(file=here("Figures","FigS2.jpg"), units ="in",width = 10, height = 8,res = 1000)
ggplot(veal,aes(x =factor(DF),fill=factor(output))) +
theme(legend.title = element_blank())+
scale_fill_tableau(labels=c("Negative","Positive")) +
scale_color_manual(labels=c("Negative","Positive")) +
theme(legend.text = element_text(size = 10),
legend.margin = margin(6, 2, 6, 2),legend.position = "bottom")+
geom_bar(position="fill")+
theme(plot.title = element_text(hjust = 0.5,size=15))+
ggtitle(expression(paste("Percentage of ESC-R ",italic("E. coli"), "at dairy farms")))+
labs(y = expression(paste("Percentage of ESC-R ",italic("E. coli")," (%)"), x = "Dairy farms"))+
theme(axis.title.x = element_blank())+
scale_y_continuous(labels = scales::percent_format(accuracy = 1))+
scale_x_discrete(labels=c("DF1","DF2","DF3","DF4","DF5","DF6","DF7","DF8","DF9","DF10","DF11","DF12","DF13"),element_text(size=10))
dev.off()
ggplot(veal,aes(x =factor(treatment),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("Ages fo the veal calves")
ggplot(veal,aes(x =factor(`#Cows`),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("Number of lactating cows at the farm")
ggplot(veal,aes(x =factor(HousingCows),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("Housing of the cows")
ggplot(veal,aes(x =factor(OtherAnimals),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("Presence of other animals 0=no; 1=dog(s); 2= cat(s), 3= dog(s)/cat(s) and other")
ggplot(veal,aes(x =factor(OtherJob),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("If the farmer has another job next to taking care of the dairy farm 0=no; 1= yes ")
ggplot(veal,aes(x =factor(HealthStatus),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+
ggtitle("What is the health status of your farm?")
ggplot(veal,aes(x =factor(HousingDryPeriod),fill=factor(output))) +
labs(fill="ESBL")+
geom_bar(position="fill")+
scale_fill_tableau() +
scale_color_tableau() +
geom_text(aes(label = ..count..), stat = "count", position = position_fill(.5))+
theme(axis.text.x = element_text(angle = 45, hjust = 1, vjust = 0.5))+