Lillie Ridgley
220254110
Table 1
| Town | House_no | Water_salin | House average | Town average | house Varience | town varience |
|---|---|---|---|---|---|---|
| Talu | 223 | 573 mg/L | ||||
| Talu | 223 | 553 mg/L | ||||
| Talu | 223 | 562 mg/L | ||||
| Talu | 223 | 559 mg/L | ||||
| Talu | 223 | 570 mg/L | ||||
| Talu | 223 | 573 mg/L | 573 mg/L | 68.4 | ||
| Talu | 49 | 555 mg/L | ||||
| Talu | 49 | 552 mg/L | 555 mg/L | 4.5 | ||
| Talu | 128 | 552 mg/L | ||||
| Talu | 84 | 554 mg/L | ||||
| Talu | 84 | 562 mg/L | 554 mg/L | 32 | ||
| Talu | 228 | 548 mg/L | 573 mg/L | 74.99 | ||
| Maeva | 546 | 545 mg/L | ||||
| Maeva | 546 | 551 mg/L | ||||
| Maeva | 546 | 537 mg/L | ||||
| Maeva | 546 | 559 mg/L | ||||
| Maeva | 546 | 547 mg/L | 545 mg/L | 65.2 | ||
| Maeva | 493 | 544 mg/L | ||||
| Maeva | 96 | 544 mg/L | ||||
| Maeva | 96 | 545 mg/L | ||||
| Maeva | 96 | 537 mg/L | 544 mg/L | 13.67 | ||
| Maeva | 325 | 539 mg/L | ||||
| Maeva | 214 | 545 mg/L | 545 mg/L | 40.16 | ||
| Kinsale | 260 | 504 mg/L | ||||
| Kinsale | 116 | 524 mg/L | ||||
| Kinsale | 80 | 516 mg/L | ||||
| Kinsale | 330 | 525 mg/L | ||||
| Kinsale | 214 | 509 mg/L | 504 mg/L | 224.7 |
Table 2
| Town | Water_body_Type | Heart_Disease | Oncology | Antenatal_Clinic | Stroke_Clinic | Primary_Education | Secondary_Education | Average_Water_Salinity |
|---|---|---|---|---|---|---|---|---|
| Maeva | in_land | 0 | 5 | 14 | 6 | 98 | 135 | 545 mg/L |
| Talu | coastal | 2 | 1 | 9 | 4 | 66 | 140 | 573 mg/L |
| Kinsale | none | 2 | 2 | 2 | 5 | 70 | 107 | 504 mg/L |
Table 3
| Town | Population | PopHD % | PopONC% | PopANTE% | PopSTRO% | PopPE% | PopSE% | Water_Salinity PopVar |
|---|---|---|---|---|---|---|---|---|
| Maeva | 1199 | 0.00% | 0.42% | 1.17% | 0.5% | 8.17% | 11.26% | 36.51 |
| Talu | 850 | 0.24% | 0.12% | 1.06% | 0.47% | 7.76% | 16.47% | 68.74 |
| Kinsale | 753 | 0.27% | 0.27% | 0.27% | 0.66% | 9.3% | 14.21% | 179.76 |
Figure 1
Figure 2
( Data Collected from the island of Bonne Santé. Please note: Columns in grey account for total count across all towns. )
Figure 3
> round(0.417014178482068, digits = 2)
[1] 0.42
> round(1.167639699749791, digits = 2)
[1] 1.17
> round(0.500417014178482, digits = 2)
[1] 0.5
> round(8.17347789824854, digits = 2)
[1] 8.17
> round(11.259382819015847, digits = 2)
[1] 11.26
> x <- c(545, 551, 537, 559, 547, 544, 544, 545, 537, 539, 545)
> var_pop <- function(x) {mean((x - mean(x))^2)}
> var_pop(x)
[1] 36.5124
> round(36.5124, digits = 2)
[1] 36.51
> x <- c(504, 542, 516, 525, 509)
> var_pop(x)
[1] 179.76
> x <- c(573, 553, 562, 559, 570, 573, 555, 552, 552, 554, 562, 548)
> var_pop(x)
[1] 68.74306
> round(68.74306, digits = 2)
[1] 68.74
> round(0.23529417647059, digits = 2)
[1] 0.24
> round(0.265604249667995, digits = 2)
[1] 0.27
> round(0.117647058823529, digits = 2)
[1] 0.12
> round(1.058823529411765, digits = 2) [
1] 1.06
> round(0.470588235294118, digits = 2) [1] 0.47
> roundfunction (x, digits = 0) .Primitive("round")
> round(0.664010624169987, digits = 2)
[1] 0.66
> round(7.764705882352941, digits = 2) [1] 7.76 > round(9.296148738379814, digits = 2) [1] 9.3 > round(16.470588235294118, digits = 2) [1] 16.47 > round function (x, digits = 0) .Primitive("round") > round(14.209827357237716, digits = 2) [1] 14.21
> library(readxl)
> theislands_watersal <- read_excel("~/Desktop/STAT100 assessmet 1/theislands.watersal.xlsx")
> View(theislands_watersal) > library(ggplot2)
> ggplot(data = theislands_watersal, aes(x=Town, y=Water_salin)) + geom_point()
>library(readxl)
> theislands_summary <- read_excel("~/Desktop/STAT100 assessmet 1/theislands.summary.xlsx")
> View(theislands_summary)
> library(tidyr)
> theislands_summary<-pivot_longer(theislands_summary, cols = c("Heart_Disease", "Oncology", "Antenatal_Clinic", "Stroke_Clinic"), names_to = "variables", values_to = "Number")
>library(ggplot2)
> barchart + geom_col(data = theislands_summary, aes(x = Town, y = Number, fill = variables), position = "dodge")
> library(tidyr)
> theislands_summary<-pivot_longer(theislands_summary, cols = c("Primary_Education", "Secomdary_Education"), names_to = "Education", values_to = "Count")
Error in `pivot_longer()`: ! Can't subset columns that don't exist. ✖ Column `Secomdary_Education` doesn't exist. Run `rlang::last_trace()` to see where the error occurred.
> theislands_summary<-pivot_longer(theislands_summary, cols = c("Primary_Education", "Secondary_Education"), names_to = "Education", values_to = "Count")
> library(ggplot2)
> barchart + geom_col(data = theislands_summary, aes(x = Town, y = Count, fill = Education), position = "dodge")
> theislands_summary<-theislands_summary[, -c(3,4,5,6)] > barchart + geom_col(data = theislands_summary, aes(x = Town, y = Count, fill = Education), position = "dodge")
> library(ggplot2) > barchart + geom_col(data = theislands_summary, aes(x = Town, y = Count, fill = Education), position = "dodge")
> barchart + geom_col(data = theislands_summary, aes(x = Town, y = Count, fill = Education), position = "dodge")