Important to know

Question 1 (10 points)

For this assignment, you will be working with 2015 November Election Results from TUIK. Click here to download the data as an Excel document. Also, click here to download the assignment as an R Markdown document. You have to complete that document and return it to your instructor.

Your first task is to load the data into R. You are NOT allowed to change the XLS file in any way. All grading tests will be run on the original XLS file. If you assume a changed XLS file, than you risk losing full grades for the whole assignment.

Your Answer

# Load the excel data into R object rawData
rawData <- ...TODO...

# Read and process the region names from the Excel file into the cities object
# Be careful, the region names in the Excel file do not well behave! You have to fix things.

...TODO...

# Add the region and type columns
type <- rep(c("Toplam", "Yurt içi", "Yurt Dışı"), length.out = length(cities))
rawData <- cbind(rawData, Cevre = cities, Tip = type)
rawData <- rawData[, c(ncol(rawData) - 1, ncol(rawData), 1:(ncol(rawData) - 2))]

# Have a look at the structure of the rawData object
...TODO...

Question 2 (20 points)

Plot the election results (vote distribution as percentages among parties) for all votes. Your plot must display the parties in descending sorted order.

Your Answer

...TODO...

Question 3 (20 points)

This time plot the percentages for “In country” and “Off Country” votes. Place them on the same plot, side by side to be able to see how parties are affected.

Your Answer

...TODO...

Question 4 (30 points)

Draw a plot of each party’s number of winnings, i.e. the number of regions where they got the most votes among all parties. Only consider the total votes’ rows.

Your Answer

...TODO...

Question 5 (30 points)

In this question you will be comparing the performances of top 4 parties, head to head.

Your Answer

...TODO...