My project analysis examines the personal exposure to PM2.5 and black carbon (BC) in three countries: Kenya, Ghana, and Bangladesh. The dataset contains PM2.5 and BC exposure samples collected at three time points: baseline, followup 1 and followup 2. An intervention was deployed to half of the participants after baseline visit. The current Markdown focuses on the descriptive analyses for PM2.5 and BC personal exposures, the correlation between PM2.5 and BC exposure as well as plots to understand the distribution of PM2.5 and BC personal exposure by country and study phase.
To analyze the data you will need to install some R packages. These packages are tidyverse, data.table, lubridate, and knitr. The required packages can be installed using R commands as below:
installed_pkgs <- row.names(installed.packages())
pkgs <- c("tidyverse", "data.table", "lubridate", "knitr")
for(p in pkgs){
if(!(p %in% installed_pkgs)){
install.packages(p)
}
}Or you can install all R packages using the following code:
make installIf you are going to generate the analysis report using the developed docker image, you don't have to worry about the R packages installation. Please find more details in "Execute the analysis" section.
To execute the analysis with 'docker', please follow the instruction below:
- Download and save everything from this
info550repository as a.zipfile and unzip it to a folder in your desired directory. - Open
Terminalor the Windows equivalent and make sure you successfully set your current working directory to the folder you created in above step that contains all the files from thisinfo550repository using the following code.
cd folder_name_where_you_saved_all_info550_files- Then download the latest version of
wenluye/info550_projectuse the following code.
docker pull wenluye/info550_project- Now use the
docker runto start the container and generate the report and remember to "mount" your local working directory to theprojectdirectory in the container with the code below.
docker run -v path/to/current_working_directory:/project wenluye/info550_project- This will create a file called
report.htmloutput in your local working directory. You can open the report in your web browser with the code bekow.
ls
open report.html- You can also build/modify the
info550_projectdocker image locally use:
make build