Skip to content
Snippets Groups Projects
Commit 615b7ca8 authored by Lo Iacono, Giovanni Dr (School of Vet Med.)'s avatar Lo Iacono, Giovanni Dr (School of Vet Med.)
Browse files

Delete Content of Codes used in the Campylobacter project.Rmd

parent 0744560c
Branches simpleservices
No related tags found
No related merge requests found
---
title: "Content of Codes used in Campylobacter project"
author: "Gianni Lo Iacono"
bibliography: campylobacter.bib
output:
pdf_document:
toc: yes
highlight: tango
fig_caption: yes
citation_package: natbib
date: '2023-01-06'
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```
# Description of the files in this folder
## _File name:_ remove_incubation_reporting_Campylobacter.R
### _Brief Description:_
The code adjust the Campylobacter data, to remove the incubation period and reporting delay.
### _Key Features:_
The distributions of the incubation period were assumed to be log-normal [@Sartwell1995] with location parameter, $\mu$, and the scale parameter, $\sigma$ inferred by the mean, $m$, and standard deviation, $s$, of the observed data of Horn and Lake [@Horn2013] for the incubation period.
Delay in reporting was assumed to follow a uniform distribution between 1-4 days, based on informed opinion of one of the authors (G. Nichols).
### _Input Files:_ (with examples)
../Data_Base/Incubation_period_Horn_Lake.csv
```{r input, echo = FALSE}
file_name<-paste("Data_Base/Incubation_period_Horn_Lake.csv",sep="")
Incub_data<-read.csv( file_name )
head(Incub_data)
```
### Plot of Incubation Period
```{r incubation, echo=FALSE}
plot(Incub_data$day,Incub_data$freq,xlab="Day",ylab="Frequency")
```
../Data_Base/Campylobacter_reported.csv
```{r input2, echo = FALSE}
Campylobacter_data_df<-read.csv(file="Data_Base/Campylobacter_reported.csv",sep=",")
colnames(Campylobacter_data_df)<-c("Spec_Date", "POSTCODE")
head(Campylobacter_data_df)
```
### _Output Files:_ (with example)
../Data_Base/Campylobacter_adjusted_date_df.csv
```{r output, echo = FALSE}
Campylobacter_adjusted_date_df<-read.csv(file="Data_Base/Campylobacter_adjusted_date.csv",sep=",")
head(Campylobacter_adjusted_date_df[,-1])
```
<<<<<<< HEAD
<!---Different File --->
## _File name:_ [Plot_reported_and_adjusted_campylobacter_cases.R](Codes/Plot_reported_and_adjusted_campylobacter_cases.R)
### _Brief Description:_
The code plots reported and adjusted campylobacter cases.
### _Key Features:_
Data aggregated monthly
### _Input Files:_ (with examples)
../Data_Base/Campylobacter_adjusted_date.csv
```{r input3, echo = FALSE}
Campylobacter_adjusted_date_df<-read.csv("Data_Base/Campylobacter_adjusted_date.csv")
head(Campylobacter_adjusted_date_df)
```
### _Output Files:_
../Graphs/Campy_seasonal_reported.tiff
![Reported Cases](Graphs\Campy_seasonal_reported){width=40%}
../Graphs/Campy_seasonal_adjusted.tiff
![Adjusted Cases](Graphs\Campy_seasonal_adjusted){width=40%}
## _File name:_ [Pathogen_Linkage_fixed_time_lag.R](Codes/Pathogen_Linkage_fixed_time_lag.R)
### _Brief Description:_
The code associates the value of selected environmental variables to the Campylobacter cases at the location of the diagnostic laboratory postcode and date of occurrence with a chosen time-time_lag. It also associate the corresponding yearly population in the catchment areas corresponding to the diagnostic laboratory postcode.
### _Key Features:_
The time lag is an input (line 180, e.g. time_lag<-7 will take 7 days time-lag) and calculate the enviromental variables averaged (expect for cululative rainfall which calculate the cumulative sum of rain) over the past time-lag days.
The code also extract iformation about the latitude and longitude of the laboratory location.
It also estimmate the day-length based on latitude from laboratory location and time of the year.
### _Input Files:_ (with examples for humidity)
../Data_Base/MEDMI/,_variable_,.csv
where _variable_ can be:
- humidity
- max_air_temp
- min_air_temp
- rain
- wind_speed
```{r input4, echo = FALSE}
variable<-"humidity"
file<-paste("Data_Base/MEDMI/",variable,".csv",sep="")
variable_df_1<-read.csv(file)
head(variable_df_1[,c(1:7)])
```
../Data_Base/Population_catchments_1989_2016.csv
```{r input5, echo = FALSE}
catchment_population_df<-read.csv(paste("Data_Base/Population_catchments_1989_2016.csv",sep=""))
colnames(catchment_population_df)<-c("PostCode",
"residents_1989",
"residents_1990",
"residents_1991",
"residents_1992",
"residents_1993",
"residents_1994",
"residents_1995",
"residents_1996",
"residents_1997",
"residents_1998",
"residents_1999",
"residents_2000",
"residents_2001",
"residents_2002",
"residents_2003",
"residents_2004",
"residents_2005",
"residents_2006",
"residents_2007",
"residents_2008",
"residents_2009",
"residents_2010",
"residents_2011",
"residents_2012",
"residents_2013",
"residents_2014",
"residents_2015",
"residents_2016")
head(catchment_population_df)
```
../Data_Base/Campylobacter_Adjusted_date.csv
```{r input6, echo = FALSE}
Campylobacter_cases<-read.csv("Data_Base/Campylobacter_Adjusted_date.csv")
colnames(Campylobacter_cases)<-c("Date","Spec_Date", "PostCode")
head(Campylobacter_cases)
```
### _Output Files:_
../Data_Base/Laboratory_environment_,_time_lag_char_,".csv
where _time_lag_char_ is the timelag in days
```{r output2 , echo = FALSE}
time_lag_char<-"7"
merged_lab_time_lag<-read.csv(paste("Data_Base/Laboratory_environment_",time_lag_char,".csv",sep=""))
head(merged_lab_time_lag)
```
../Data_Base/Campylobacter_environment_,_time_lag_char_,".csv
where _time_lag_char_ is the timelag in days
```{r output3 , echo = FALSE}
time_lag_char<-"7"
Campylobacter_cases_df2<-read.csv(paste("Data_Base/Campylobacter_environment_",time_lag_char,".csv",sep=""))
head(Campylobacter_cases_df2)
```
=======
>>>>>>> 7ba923ff14a4c44a060bb1910e03bac7800d2cfe
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment