# Important to know

• This assignment is due in 1 week from announcement.
• Replace the author name with your name!
• You need to submit the RMD file before the due date. Do not submit HTML or PDF!

# Question 1 (10 points)

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.

# 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.

...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.

...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.

...TODO...

# Question 5 (30 points)

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

• For each one of the top four parties:
• Draw a scatterplot of their vote percentages vs each of the other parties’ vote percentages, with respect to each region
• Use the party names as x and y labels
• Draw a line with parameters a as 0, and b as 1, color it blue, and make it 2 points wide
• Draw a line with parameters a as 0, and b as .5, color it green, and make it 2 points wide
• Draw a line with parameters a as 0, and b as 2, color it red, and make it 2 points wide
• Draw a line with parameters a as 20, and b as -1, color it orange, and make it 2 points wide
• All three plots for each party must be placed on a single plot
• Comment on the plots from an exploratory perspective. What do these plots tell you?

...TODO...