Transcribed TextTranscribed Text

During your first lunch at the ABI your new boss has asked you to produce a nice graph for a presentation the next week. Your boss tells you that she is interested getting a graph of the fund: Nordea Nordenfond. She wants to know how the market value for the fund has changed between the years 2006 and 2015 on a quarterly basis. She also wants to know how large percentage of the fund’s value consists of Finland companies. During the lunch she drew on a napkin what she sought to get, see Figure 1 Back at the office a colleague hands you a zip-file, see provided file, which contains fund data over the interesting years. This data comes from The Fin Financial Supervisory’s webpage, source. Given this data you can now start to work on the graph. Your task in this lab is simply to produce that high-resolution image your boss asked for. You should solve this task by using R. To pass the lab you need to hand in both the image as well R-code. Also hand in a readme.txt which contains instructions for how to run the code. Your code should extract the relevant data as well as produce the image.

Solution PreviewSolution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

#PART 1: Defining utility functions tobe used later with the script
#Define utility functions starts
#Function for populating date
last <- function (x){ x[length(x)] }   

fill.NAs <- function(isNA){#function starts
    if (isNA[1] == 1) {
      isNA[1:max({which(isNA==0)[1]-1},1)] <- 0 # first is NAs
      # can't be forward filled
    which_isNA <- isNA_pos <- isNA_diff <- diff(isNA)
    isNA_pos[isNA_diff < 0] <- 0
    which_isNA[isNA_diff > 0] <- 0
    which_isNA_neg <- which(as.logical(which_isNA))
    if (length(which_isNA_neg)==0) return(NULL) # generates warnings later, but works
    which_isNA_pos <- which(as.logical(isNA_pos))
    which_isNA <- which(as.logical(isNA))
    if (length(which_isNA_neg)==length(which_isNA_pos)){
      replacement <- rep(which_isNA_pos[2:length(which_isNA_neg)],
                         which_isNA_neg[2:max(length(which_isNA_neg)-1,2)] -...
$30.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Statistics-R Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats