################################################################################
### R BASICS WORKSHOP ###
### EXERCISE 8.3: Graphics ###
### ###
### Center for Conservation and Sustainable Development ###
### Missouri Botanical Garden ###
### Website: rbasicsworkshop.weebly.com ###
################################################################################
# NOTE that this exercise is a bit more advanced and un-assited.
## TASK 1 ##
# Open the data in files Data_AlcoholConsumption.xlsx and Data_AdultLiteracy.xlsx
# in R. Note that you have to either transform them into .txt files, or find a
# package with a function that can open xlsx files. These files contain data on
# literaty (% of people >15 years old) per country per year, and similar data
# for consumption of alcohol (average per adult).
## TASK 2 ##
# Choose a recent year and 10 countries of your interest, and make a barplot in
# which you compare literacy rates between the countries.
## TASK 3 ##
# Make a similar barplot for alcohol comsumption and save it as a jpeg or pdf
# file.
## TASK 4 ##
# Choose a recent year for the literacy dataset that has a good amount of data,
# and a similar year for the alcohol dataset. Now make a scatterplot relating
# the two variables. Note that the names of the countries need to match in both
# datasets. Some countries might be in one dataset but not the other, and might
# need to be removed
## TASK 5 ##
# Use the function lm to fit a regression to this relationship, saving the
# results into an object. Now, use the function summary on that object to print
# a summary of the results on the screen.