library(dplyr)
## Warning: package 'dplyr' was built under R version 3.6.1
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
arsenic <- read.csv("C:/Users/joyof/Desktop/JOY OFIELU MBA 676/arsenic.csv")
flouride <- read.csv("C:/Users/joyof/Desktop/JOY OFIELU MBA 676/flouride.csv")
join<-full_join(arsenic,flouride,suffix=c(".arsenic",".flouride") ,by="location")
 head(join)
##         location n_wells_tested.arsenic
## 1     Manchester                    275
## 2         Gorham                    467
## 3       Columbia                     42
## 4       Monmouth                    277
## 5          Eliot                     73
## 6 Columbia Falls                     25
##   percent_wells_above_guideline.arsenic median.arsenic
## 1                                  58.9           14.0
## 2                                  50.1           10.5
## 3                                  50.0            9.8
## 4                                  49.5           10.0
## 5                                  49.3            9.7
## 6                                  48.0            8.1
##   percentile_95.arsenic maximum.arsenic n_wells_tested.flouride
## 1                 93.00             200                     276
## 2                130.00             460                     452
## 3                 65.90             200                      54
## 4                110.00             368                     288
## 5                 41.35              45                      84
## 6                 53.75              71                      38
##   percent_wells_above_guideline.flouride median.flouride
## 1                                    3.3            0.30
## 2                                    0.0            0.10
## 3                                    1.9            0.31
## 4                                    3.1            0.30
## 5                                    0.0            0.20
## 6                                    0.0            0.21
##   percentile_95.flouride maximum.flouride
## 1                  1.700             3.60
## 2                  0.682             2.00
## 3                  1.329             4.30
## 4                  1.676             3.40
## 5                  0.658             1.54
## 6                  0.641             0.90
join%>%select(location,percent_wells_above_guideline.arsenic,percent_wells_above_guideline.flouride)%>%
  arrange(desc(percent_wells_above_guideline.arsenic))%>%top_n(5)
## Selecting by percent_wells_above_guideline.flouride
##   location percent_wells_above_guideline.arsenic
## 1    Surry                                  40.3
## 2     Otis                                  39.6
## 3   Dedham                                  17.5
## 4 Prospect                                   4.0
## 5  Denmark                                   0.0
##   percent_wells_above_guideline.flouride
## 1                                   18.3
## 2                                   30.0
## 3                                   22.5
## 4                                   17.5
## 5                                   19.6
join%>%select(location,maximum.arsenic,maximum.flouride)%>%
  arrange(desc(maximum.arsenic))%>%top_n(5)
## Selecting by maximum.flouride
##      location maximum.arsenic maximum.flouride
## 1       Anson           110.0             14.0
## 2   Kennebunk            31.0              9.6
## 3        Peru            25.0              9.9
## 4     Ashland             6.9             10.0
## 5 Frenchville             6.9             10.0
join%>%select(location,median.arsenic,median.flouride)%>%
  arrange(desc(median.arsenic))%>%top_n(5)
## Selecting by median.flouride
##     location median.arsenic median.flouride
## 1      Surry            6.0            0.80
## 2       Otis            4.8            1.13
## 3  Eastbrook            1.5            1.29
## 4     Dedham            1.0            0.94
## 5 Marshfield            1.0            1.00
joined <- join%>%select(location,percentile_95.arsenic,percentile_95.flouride)%>%
  arrange(desc(percentile_95.arsenic))%>%top_n(5)
## Selecting by percentile_95.flouride

Arsenic: Arsenic is a gray chemical known as an element metalloid it has the ability to combine with both organic and inorganic substances. Arsenic is found in groundwater, many chemicals, and foods. The inorganic is very toxic to both human and animals. While organic arsenic which combines with organic substances is nontoxic or less toxic. The symptoms differ with the amount of poison consumed. Inorganic arsenic can cause destruction of red blood cells, shock, and sudden death but lower concentration may not have much symptoms. Organic and Inorganic arsenic poisoning is determined by the quantity of concentration in blood and urine. Acute toxic treatment needs immediate action and can be done by dialysis, chelating agents, replacement of red blood cells. Bowel cleansing is done when ingested. Though acute toxic inorganic arsenic has poor outcome but chronic poisoning has better outcome.

Fluoride: Fluoride is a chemical element of fluorine. It is added to public water for prevention of tooth decay It is added to toothpaste to prevent tooth decay. It is used as medicine for prevention of tooth decay. It is also added to mouthwash to prevent plaque, swelling of gum and tooth decay. It helps to prevent bone loss.it also helps with bone formation

https://www.medicinenet.com/arsenic_poisoning/article.htm#arsenic_facts https://www.webmd.com/vitamins/ai/ingredientmono-1068/fluoride

From the data analysis with the locations in state of Maine we can see that Surry has the highest percentile of arsenic and Marshfield minimum percentile. On the other hand, Charlotte has the Maximum percentile of flouride and Surry has the minimum percentile of floruride .

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.6.1
ggplot(data=joined, aes(x=joined$percentile_95.flouride)) + geom_bar()