# Prevalence Of Drug Use Disorders Males vs Females * Prevalence, "Share (%) of population suffering from drug use disorders, in males versus females. " ## Software required to recreate plots: * Install: R language, RTools40, RStudio, and GGPLot2 (see link below). * Download code and data from Github.com (see link below). * Move R code and data to working directory ## Run code: ``` install.packages("ggplot2") library(ggplot2) rm(list=ls()) df <- read.csv("./prevalence-of-drug-use-disorders-males-vs-females.csv") US <- subset(df,Code =="USA" & Year >="1990") ## Plot1: plot(US$Year,US$Male,main="Male",type="l") grid(col="gray") ## Plot2: plot(US$Year,US$Female,type="l",main="Female") grid(col="gray") ## Plot 3: ggplot(US) + geom_line(aes(x=Year,y=Male,col="Males")) + geom_line(aes(x=Year,y=Female,col="Female")) + labs(title="Share(%) of population suffering from drug use disorders: males versus females",y="Drug use prevalence ") ``` ## Plots: => https://github.com/davidjayjackson/Gemini-content/blob/main/female-prevalence.png (Plot1) Female Prevalence => https://github.com/davidjayjackson/Gemini-content/blob/main/male-prevalence.png (Plot2) Male Prevalence => https://github.com/davidjayjackson/Gemini-content/blob/main/ggplot2_prevalence.png (GGPlot2) Combined Male and Female Prevalence ## Resources: => https://github.com/davidjayjackson/Gemini-content R Code, data => https://cloud.r-project.org/ R Language and Rtools10 (click and "base" and "Rtools") => https://rstudio.com/products/rstudio/download/ Download and install RStduio