-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.Rmd
66 lines (55 loc) · 2.86 KB
/
index.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
57
58
59
60
61
62
63
64
65
---
title: "Dictionary of variables of the final data set"
output:
html_document:
theme: cosmo
toc: true
editor_options:
chunk_output_type: console
css: style.css
---
```{r general_options, include = FALSE}
knitr::knit_hooks$set(
margin = function(before, options, envir) {
if (before) par(mgp = c(1.5, .5, 0), bty = "n", plt = c(.105, .97, .13, .97))
else NULL
},
prompt = function(before, options, envir) {
options(prompt = if (options$engine %in% c("sh", "bash")) "$ " else "> ")
})
knitr::opts_chunk$set(margin = TRUE, prompt = TRUE, comment = "",
collapse = TRUE, cache = FALSE, autodep = TRUE,
dev.args = list(pointsize = 11), fig.height = 3.5,
fig.width = 4.24725, fig.retina = 2, fig.align = "center")
options(width = 250)
```
The data set, as a flat rectangular CSV file, can be downloaded from
[here](https://raw.githubusercontent.com/viparc/clires_data/master/data/viparc.csv):
```{r}
# install.packages("readr")
viparc <- readr::read_csv("https://raw.githubusercontent.com/viparc/clires_data/master/data/viparc.csv",
col_types = paste(c("ciillidddllllll", rep("d", 45)), collapse = ""))
```
```{r include = FALSE}
nb_ab <- sum(grepl("_g", names(viparc))) - 1
```
The data frame contains `r nrow(viparc)` weeks of observation (rows) and
`r ncol(viparc)` variables (columns). The variables are
* **farm:** farm ID;
* **flock:** flock ID (in a given farm);
* **week:** week number (in a given flock of a given farm);
* **sampling:** boolean informing whether there is feces sampling during the week (`TRUE`) or not (`FALSE`);
* **completed:** boolean informing whether the flock is done (`TRUE`) or still ongoing (`FALSE`);
* **nb_chicken:** total number of chicken in the farm;
* **nb_chicken_sold:** total number of chicken sold from the farm;
* **chicken_disease_death** number of chicken in the farm that died from disease between the previous and the current weeks;
* **chicken_sudden_death** number of chicken in the farm that suddenly died (from other causes than the disease) between the previous and the current weeks;
* **respiratory, ..., sudden_death:** presence (`TRUE`) / absence (`FALSE`) of 6 clinical signs in the flock;
* **chicken_disease_death**: number of chicken dying from disease between the previous and the current weeks;
* **chicken_sudden_death**: number of chicken suddenly dying (from other cause than disease) between the previous and the current weeks;
* **amoxicillin_g, ..., unknown_g:** mass, in g, of the `r nb_ab` antimicriobial used in the flock.
In addition, there is also information on the antimicrobial class of each
antimicrobial used in the data set. These data can be download from here:
```{r}
ab_classes <- readr::read_csv("https://raw.githubusercontent.com/viparc/clires_data/master/data/antimicrobial_classes.csv", col_types = "cc")
```