In [3]:
## Exercise 2.9

birth_year <- 37
death_year <- 68
reign_start <- 54
regin_stop <- 64

live_lenght = death_year - birth_year
regin_lenght = regin_stop - reign_start

print( paste("Nero was in power for ", regin_lenght / live_lenght, "of his life" ) )
[1] "Nero was in power for  0.32258064516129 of his life"
In [4]:
## 2.11

price <- 250000
area <- 75
cost_per_square_meter <- price / area

print( cost_per_square_meter )
[1] 3333.333
In [7]:
## 2.12

text <- "Coding Social Science is fun."
print( tolower( text ) )
print( toupper( text ) )
[1] "coding social science is fun."
[1] "CODING SOCIAL SCIENCE IS FUN."
In [15]:
## 2.13

text <- "I'm starting to do and understand computational social science."
print( substr( text, 1, 1) )
print( substr( text, 20, 20)  )
print(  substr( text, nchar(text), nchar(text) )  )
[1] "I"
[1] "a"
[1] "."
In [17]:
## 2.14

for( i in 1:5) {
    print( i )
}

for( i in 1:50) {
    print( i )
}

for( i in 1:100) {
    print( i )
}

for( i in 50:100) {
    print( i )
}
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
[1] 21
[1] 22
[1] 23
[1] 24
[1] 25
[1] 26
[1] 27
[1] 28
[1] 29
[1] 30
[1] 31
[1] 32
[1] 33
[1] 34
[1] 35
[1] 36
[1] 37
[1] 38
[1] 39
[1] 40
[1] 41
[1] 42
[1] 43
[1] 44
[1] 45
[1] 46
[1] 47
[1] 48
[1] 49
[1] 50
[1] 1
[1] 2
[1] 3
[1] 4
[1] 5
[1] 6
[1] 7
[1] 8
[1] 9
[1] 10
[1] 11
[1] 12
[1] 13
[1] 14
[1] 15
[1] 16
[1] 17
[1] 18
[1] 19
[1] 20
[1] 21
[1] 22
[1] 23
[1] 24
[1] 25
[1] 26
[1] 27
[1] 28
[1] 29
[1] 30
[1] 31
[1] 32
[1] 33
[1] 34
[1] 35
[1] 36
[1] 37
[1] 38
[1] 39
[1] 40
[1] 41
[1] 42
[1] 43
[1] 44
[1] 45
[1] 46
[1] 47
[1] 48
[1] 49
[1] 50
[1] 51
[1] 52
[1] 53
[1] 54
[1] 55
[1] 56
[1] 57
[1] 58
[1] 59
[1] 60
[1] 61
[1] 62
[1] 63
[1] 64
[1] 65
[1] 66
[1] 67
[1] 68
[1] 69
[1] 70
[1] 71
[1] 72
[1] 73
[1] 74
[1] 75
[1] 76
[1] 77
[1] 78
[1] 79
[1] 80
[1] 81
[1] 82
[1] 83
[1] 84
[1] 85
[1] 86
[1] 87
[1] 88
[1] 89
[1] 90
[1] 91
[1] 92
[1] 93
[1] 94
[1] 95
[1] 96
[1] 97
[1] 98
[1] 99
[1] 100
[1] 50
[1] 51
[1] 52
[1] 53
[1] 54
[1] 55
[1] 56
[1] 57
[1] 58
[1] 59
[1] 60
[1] 61
[1] 62
[1] 63
[1] 64
[1] 65
[1] 66
[1] 67
[1] 68
[1] 69
[1] 70
[1] 71
[1] 72
[1] 73
[1] 74
[1] 75
[1] 76
[1] 77
[1] 78
[1] 79
[1] 80
[1] 81
[1] 82
[1] 83
[1] 84
[1] 85
[1] 86
[1] 87
[1] 88
[1] 89
[1] 90
[1] 91
[1] 92
[1] 93
[1] 94
[1] 95
[1] 96
[1] 97
[1] 98
[1] 99
[1] 100
In [21]:
## 2.15

data <- read.csv("emperors_small.csv", header = F)

for ( i in 1: nrow ( data ) ){
    name <- data [i ,1]
    birth_year <- data [i ,2]
    death_year <- data [i ,3]
    start_of_reign <- data [i ,4]
    end_of_reign <- data [i ,5]
    age <- death_year - birth_year
    print( age )
}
[1] 37
[1] 54
[1] 70
[1] 42
[1] 45
[1] 68
[1] 64
[1] 62
[1] 75
[1] 59
[1] 31
[1] 67
[1] 60
[1] 66
[1] 29
In [22]:
## 2.16

data <- read.csv("emperors_small.csv", header = F)

for ( i in 1: nrow ( data ) ){
    name <- data [i ,1]
    birth_year <- data [i ,2]
    death_year <- data [i ,3]
    start_of_reign <- data [i ,4]
    end_of_reign <- data [i ,5]
    life_lenghth <- death_year - birth_year
    regin_length <-  end_of_reign - start_of_reign
    print( regin_length / life_lenghth )
}
[1] 0
[1] 0
[1] 0.1428571
[1] 0.04761905
[1] 0.3333333
[1] 0.02941176
[1] 0.296875
[1] 0.3387097
[1] 0.3066667
[1] 0.3220339
[1] 0
[1] 0
[1] 0
[1] 0.2727273
[1] 0.6551724
In [26]:
## 2.17

## step 1: logic of fizzbuzz

number <- 5

if( number %% 5 == 0 && number %% 3 == 0 ) {
    print("fizzbuzz")
} else {
    if( number %% 5 == 0 ){
        print("buzz")
    } else {
        if( number %% 3 == 0 ){
            print("fizz")
        } else {
            print( number )
        }
    }    
}
            
## step 2: repeat command when correct
            
for( number in 1:100 ) {
    if( number %% 5 == 0 && number %% 3 == 0 ) {
        print("fizzbuzz")
    } else {
        if( number %% 5 == 0 ){
            print("buzz")
        } else {
            if( number %% 3 == 0 ){
                print("fizz")
            } else {
                print( number )
            }
        }    
    }
}
[1] "buzz"
[1] 1
[1] 2
[1] "fizz"
[1] 4
[1] "buzz"
[1] "fizz"
[1] 7
[1] 8
[1] "fizz"
[1] "buzz"
[1] 11
[1] "fizz"
[1] 13
[1] 14
[1] "fizzbuzz"
[1] 16
[1] 17
[1] "fizz"
[1] 19
[1] "buzz"
[1] "fizz"
[1] 22
[1] 23
[1] "fizz"
[1] "buzz"
[1] 26
[1] "fizz"
[1] 28
[1] 29
[1] "fizzbuzz"
[1] 31
[1] 32
[1] "fizz"
[1] 34
[1] "buzz"
[1] "fizz"
[1] 37
[1] 38
[1] "fizz"
[1] "buzz"
[1] 41
[1] "fizz"
[1] 43
[1] 44
[1] "fizzbuzz"
[1] 46
[1] 47
[1] "fizz"
[1] 49
[1] "buzz"
[1] "fizz"
[1] 52
[1] 53
[1] "fizz"
[1] "buzz"
[1] 56
[1] "fizz"
[1] 58
[1] 59
[1] "fizzbuzz"
[1] 61
[1] 62
[1] "fizz"
[1] 64
[1] "buzz"
[1] "fizz"
[1] 67
[1] 68
[1] "fizz"
[1] "buzz"
[1] 71
[1] "fizz"
[1] 73
[1] 74
[1] "fizzbuzz"
[1] 76
[1] 77
[1] "fizz"
[1] 79
[1] "buzz"
[1] "fizz"
[1] 82
[1] 83
[1] "fizz"
[1] "buzz"
[1] 86
[1] "fizz"
[1] 88
[1] 89
[1] "fizzbuzz"
[1] 91
[1] 92
[1] "fizz"
[1] 94
[1] "buzz"
[1] "fizz"
[1] 97
[1] 98
[1] "fizz"
[1] "buzz"
In [27]:
## 2.18

year <- 1999

if( year %% 100 == 0 ){
    if( year %% 400 == 0 ) { ## if it is divisible by 100, it is a leap year only if it can also be divided by 400.
        print( paste( year, "is leap year") )
    } else {
        print( paste( year, "is not a leap year") )
    }
} else {
    if( year %% 4 == 0 ) { ## A year is a leap year if it can be divided by 4.
        print( paste( year, "is leap year") )
    } else {
        print( paste( year, "is not a leap year") )
    }
}
[1] "1999 is not a leap year"
In [28]:
## 2.19

for( year in 1990:2050 ) {
    if( year %% 100 == 0 ){
        if( year %% 400 == 0 ) { ## if it is divisible by 100, it is a leap year only if it can also be divided by 400.
            print( year )
        }
    } else {
        if( year %% 4 == 0 ) { ## A year is a leap year if it can be divided by 4.
            print( year )
        }
    }
}
[1] 1992
[1] 1996
[1] 2000
[1] 2004
[1] 2008
[1] 2012
[1] 2016
[1] 2020
[1] 2024
[1] 2028
[1] 2032
[1] 2036
[1] 2040
[1] 2044
[1] 2048
In [31]:
## 2.20

most_wanted_holder <- 0

data <- read.csv("numbers.txt")

for( row_number in 1:nrow( data ) )  {
    number <- data[row_number, 1]
    if( number > most_wanted_holder ) {
        most_wanted_holder <- number
    }
}

print( paste("The highest number is", most_wanted_holder ) )
[1] "The highest number is 9"
In [32]:
## 2.21

gatherer <- 0

data <- read.csv("numbers.txt")

for( row_number in 1:nrow( data ) )  {
    number <- data[row_number, 1]
    gatherer <- gatherer + number
}

print( paste("The sum of the numbers is", gatherer ) )
[1] "The sum of the numbers is 31"
In [40]:
## 2.22

flag <- FALSE
looking_for <- 42

data <- read.csv("numbers.txt")

for( row_number in 1:nrow( data ) )  {
    number <- data[row_number, 1]
    if( number == looking_for )  {
        flag <- TRUE
    }
}

if( flag == TRUE ){
    print( paste("The file contains the value", looking_for ) )
} else {
    print( paste("The file does not contain the value", looking_for ) )
}
[1] "The file does not contain the value 42"
In [42]:
## 2.23

most_wanted_holder <- 0
most_wanted_follower <- 0

data <- read.csv("numbers.txt")

for( row_number in 1:nrow( data ) )  {
    number <- data[row_number, 1]
    if( number > most_wanted_holder ) {
        most_wanted_follower <- most_wanted_holder
        most_wanted_holder <- number
    }
}

print( paste("The second highest number is", most_wanted_follower ) )
[1] "The second highest number is 7"
In [43]:
## 2.24

age_most_wanted <- 999 ## large number
name_most_wanted <- "" ## this is a follower variable

data <- read.csv("emperors_small.csv", header = FALSE )

for( row_number in 1:nrow(data )) {
    name <- data[ row_number, 1 ]
    birth_year <- data[ row_number, 2 ]
    death_year <- data[ row_number, 3 ]
    age <- death_year - birth_year
    
    if( age < age_most_wanted ) {
        age_most_wanted <- age
        name_most_wanted <- name
    }
}

print( paste( "Youngest person to become Roman emperor was", name ) )
[1] "Youngest person to become Roman emperor was Caracalla"
In [45]:
## 2.35

votes_a1 <- 300
votes_a2 <- 750
votes_a3 <- 345
votes_a4 <- 105

votes_a <- votes_a1 + votes_a2 + votes_a3 + votes_a4

votes_b1 <- 1000
votes_b2 <- 300

votes_b <- votes_b1 + votes_b2

votes_c1 <- 301
votes_c2 <- 300
votes_c3 <- 299

votes_c <- votes_c1 + votes_c2 + votes_c3

votes_d1 <- 202
votes_d2 <- 201
votes_d3 <- 198
votes_d4 <- 199

votes_d <- votes_d1 + votes_d2 + votes_d3 + votes_d4

print( paste( votes_a , votes_b, votes_c, votes_d ) )
[1] "1500 1300 900 800"
In [46]:
## 2.26

total_votes <- votes_a + votes_b + votes_c + votes_d

print( votes_a / total_votes )
print( votes_b / total_votes )
print( votes_c / total_votes )
print( votes_d / total_votes )
[1] 0.3333333
[1] 0.2888889
[1] 0.2
[1] 0.1777778
In [47]:
## 2.27

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
}
In [48]:
## 2.28

total_votes_gatherer <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    total_votes_gatherer <- total_votes_gatherer + votes
}
  
print( total_votes_gatherer )
[1] 96589152
In [49]:
## 2.29

party_b_votes_gatherer <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( party == "PartyB" ) {
        party_b_votes_gatherer <- party_b_votes_gatherer + votes
    }
}
    
print( party_b_votes_gatherer )
[1] 21572206
In [51]:
## 2.30

votes_gatherer <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( endsWith( name, "a") ) {
        votes_gatherer <- votes_gatherer + votes
    }
}
    
print( votes_gatherer )
[1] 20154016
In [54]:
## 2.31

votes_A_gatherer <- 0
votes_K_gatherer <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( startsWith( name, 'A') ) {
        votes_A_gatherer <- votes_A_gatherer + votes
    }
    
    if( startsWith(name, 'K') ) {
        votes_K_gatherer <- votes_K_gatherer + votes
    }
}
        
print( votes_A_gatherer )
print( votes_K_gatherer )
print( votes_A_gatherer / votes_K_gatherer ) ## relative voute counts
[1] 14500641
[1] 6369396
[1] 2.276612
In [55]:
## 2.32

candidates_before_1980_collector <- 0
    
data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( birth_year < 1980 ) {
        candidates_before_1980_collector <- candidates_before_1980_collector + 1
    }
}
        
print( candidates_before_1980_collector )
[1] 113
In [56]:
## 2.33

votes_before_1980_collector <- 0
votes_after_1980_collector <- 0

data <- read.csv("elections.txt", header = FALSE )
    
for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( birth_year < 1980 ) {
        votes_before_1980_collector <- votes_before_1980_collector + votes
    } else {
        votes_after_1980_collector <- votes_after_1980_collector + votes
    }
}  
        
if( votes_before_1980_collector > votes_after_1980_collector ) {
    print("People born before 1980 recieved more votes")
} else {
     print("People born 1980 or after recieved more votes")
}
[1] "People born before 1980 recieved more votes"
In [58]:
## 2.34

votes_before_1980_collector <- 0
votes_after_1980_collector <- 0

candidates_before_1980_collector <- 0
candidates_after_1980_collector <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( birth_year < 1980 ) {
        votes_before_1980_collector <- votes_before_1980_collector + votes
        candidates_before_1980_collector <- candidates_before_1980_collector + 1
    } else {
        votes_after_1980_collector <- votes_after_1980_collector + votes
        candidates_after_1980_collector <- candidates_after_1980_collector + 1
    }
}        
        
if( votes_before_1980_collector / candidates_before_1980_collector > votes_after_1980_collector / candidates_after_1980_collector ) {
    print("People born before 1980 recieved more votes")
} else {
    print("People born 1980 or after recieved more votes")
}
[1] "People born 1980 or after recieved more votes"
In [60]:
## 2.35

most_voted_candidate_votes <- 0
most_voted_candidate_name <- ''

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( party == 'PartyB' ) {
        if( votes > most_voted_candidate_votes )  {
            most_voted_candidate_votes <- votes
            most_voted_candidate_name <- name
        }
    }
}           
            
print( paste( most_voted_candidate_name, most_voted_candidate_votes ) )
[1] "Armo Pautamo 895747"
In [61]:
## 2.37

party_b_candidate_count <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( party == 'PartyB' ) {
        party_b_candidate_count <- party_b_candidate_count  + 1
    }
}
            
print( party_b_candidate_count )
[1] 46
In [62]:
## 2.38

candidate_count <- party_b_candidate_count
party_votes <- party_b_votes_gatherer

for( i in 1:candidate_count ) {
    print( paste("Candidate", i,  party_votes / i ) )
}
[1] "Candidate 1 21572206"
[1] "Candidate 2 10786103"
[1] "Candidate 3 7190735.33333333"
[1] "Candidate 4 5393051.5"
[1] "Candidate 5 4314441.2"
[1] "Candidate 6 3595367.66666667"
[1] "Candidate 7 3081743.71428571"
[1] "Candidate 8 2696525.75"
[1] "Candidate 9 2396911.77777778"
[1] "Candidate 10 2157220.6"
[1] "Candidate 11 1961109.63636364"
[1] "Candidate 12 1797683.83333333"
[1] "Candidate 13 1659400.46153846"
[1] "Candidate 14 1540871.85714286"
[1] "Candidate 15 1438147.06666667"
[1] "Candidate 16 1348262.875"
[1] "Candidate 17 1268953.29411765"
[1] "Candidate 18 1198455.88888889"
[1] "Candidate 19 1135379.26315789"
[1] "Candidate 20 1078610.3"
[1] "Candidate 21 1027247.9047619"
[1] "Candidate 22 980554.818181818"
[1] "Candidate 23 937922"
[1] "Candidate 24 898841.916666667"
[1] "Candidate 25 862888.24"
[1] "Candidate 26 829700.230769231"
[1] "Candidate 27 798970.592592593"
[1] "Candidate 28 770435.928571429"
[1] "Candidate 29 743869.172413793"
[1] "Candidate 30 719073.533333333"
[1] "Candidate 31 695877.612903226"
[1] "Candidate 32 674131.4375"
[1] "Candidate 33 653703.212121212"
[1] "Candidate 34 634476.647058823"
[1] "Candidate 35 616348.742857143"
[1] "Candidate 36 599227.944444444"
[1] "Candidate 37 583032.594594595"
[1] "Candidate 38 567689.631578947"
[1] "Candidate 39 553133.487179487"
[1] "Candidate 40 539305.15"
[1] "Candidate 41 526151.365853659"
[1] "Candidate 42 513623.952380952"
[1] "Candidate 43 501679.209302326"
[1] "Candidate 44 490277.409090909"
[1] "Candidate 45 479382.355555556"
[1] "Candidate 46 468961"
In [63]:
## 2.39

party_a_votes <- 0
party_b_votes <- 0
party_c_votes <- 0
party_d_votes <- 0

party_a_candidates <- 0
party_b_candidates <- 0
party_c_candidates <- 0
party_d_candidates <- 0

data <- read.csv("elections.txt", header = FALSE )

for( i in 1:nrow(data) ) {
    name <- data[i, 1]
    party <- data[i, 2]
    votes <- data[i, 3]
    birth_year <- data[i, 4]
    
    if( party == 'PartyA' ) {
        party_a_votes = party_a_votes + votes
        party_a_candidates = party_a_candidates  + 1
    }

    if( party == 'PartyB' ) {
        party_b_votes = party_b_votes + votes
        party_b_candidates = party_b_candidates  + 1
    }
    
    if( party == 'PartyC' ) {
        party_c_votes = party_c_votes + votes
        party_c_candidates = party_c_candidates  + 1
    }
    
    if( party == 'PartyD' ) {
        party_d_votes = party_d_votes + votes
        party_d_candidates = party_d_candidates  + 1
    }
    
}
        
for( i in 1:party_a_candidates ) {
    print( paste("Party A, candidate", i,  party_a_votes / i ) )
}

for( i in 1:party_b_candidates ) {
    print( paste("Party B, candidate", i,  party_b_votes / i ) )
}

for( i in 1:party_c_candidates ) {
    print( paste("Party C, candidate", i,  party_c_votes / i ) )
}

for( i in 1:party_d_candidates ) {
    print( paste("Party D, candidate", i,  party_d_votes / i ) )
}
[1] "Party A, candidate 1 19547763"
[1] "Party A, candidate 2 9773881.5"
[1] "Party A, candidate 3 6515921"
[1] "Party A, candidate 4 4886940.75"
[1] "Party A, candidate 5 3909552.6"
[1] "Party A, candidate 6 3257960.5"
[1] "Party A, candidate 7 2792537.57142857"
[1] "Party A, candidate 8 2443470.375"
[1] "Party A, candidate 9 2171973.66666667"
[1] "Party A, candidate 10 1954776.3"
[1] "Party A, candidate 11 1777069.36363636"
[1] "Party A, candidate 12 1628980.25"
[1] "Party A, candidate 13 1503674.07692308"
[1] "Party A, candidate 14 1396268.78571429"
[1] "Party A, candidate 15 1303184.2"
[1] "Party A, candidate 16 1221735.1875"
[1] "Party A, candidate 17 1149868.41176471"
[1] "Party A, candidate 18 1085986.83333333"
[1] "Party A, candidate 19 1028829.63157895"
[1] "Party A, candidate 20 977388.15"
[1] "Party A, candidate 21 930845.857142857"
[1] "Party A, candidate 22 888534.681818182"
[1] "Party A, candidate 23 849902.739130435"
[1] "Party A, candidate 24 814490.125"
[1] "Party A, candidate 25 781910.52"
[1] "Party A, candidate 26 751837.038461538"
[1] "Party A, candidate 27 723991.222222222"
[1] "Party A, candidate 28 698134.392857143"
[1] "Party A, candidate 29 674060.793103448"
[1] "Party A, candidate 30 651592.1"
[1] "Party A, candidate 31 630573"
[1] "Party A, candidate 32 610867.59375"
[1] "Party A, candidate 33 592356.454545455"
[1] "Party A, candidate 34 574934.205882353"
[1] "Party A, candidate 35 558507.514285714"
[1] "Party A, candidate 36 542993.416666667"
[1] "Party B, candidate 1 21572206"
[1] "Party B, candidate 2 10786103"
[1] "Party B, candidate 3 7190735.33333333"
[1] "Party B, candidate 4 5393051.5"
[1] "Party B, candidate 5 4314441.2"
[1] "Party B, candidate 6 3595367.66666667"
[1] "Party B, candidate 7 3081743.71428571"
[1] "Party B, candidate 8 2696525.75"
[1] "Party B, candidate 9 2396911.77777778"
[1] "Party B, candidate 10 2157220.6"
[1] "Party B, candidate 11 1961109.63636364"
[1] "Party B, candidate 12 1797683.83333333"
[1] "Party B, candidate 13 1659400.46153846"
[1] "Party B, candidate 14 1540871.85714286"
[1] "Party B, candidate 15 1438147.06666667"
[1] "Party B, candidate 16 1348262.875"
[1] "Party B, candidate 17 1268953.29411765"
[1] "Party B, candidate 18 1198455.88888889"
[1] "Party B, candidate 19 1135379.26315789"
[1] "Party B, candidate 20 1078610.3"
[1] "Party B, candidate 21 1027247.9047619"
[1] "Party B, candidate 22 980554.818181818"
[1] "Party B, candidate 23 937922"
[1] "Party B, candidate 24 898841.916666667"
[1] "Party B, candidate 25 862888.24"
[1] "Party B, candidate 26 829700.230769231"
[1] "Party B, candidate 27 798970.592592593"
[1] "Party B, candidate 28 770435.928571429"
[1] "Party B, candidate 29 743869.172413793"
[1] "Party B, candidate 30 719073.533333333"
[1] "Party B, candidate 31 695877.612903226"
[1] "Party B, candidate 32 674131.4375"
[1] "Party B, candidate 33 653703.212121212"
[1] "Party B, candidate 34 634476.647058823"
[1] "Party B, candidate 35 616348.742857143"
[1] "Party B, candidate 36 599227.944444444"
[1] "Party B, candidate 37 583032.594594595"
[1] "Party B, candidate 38 567689.631578947"
[1] "Party B, candidate 39 553133.487179487"
[1] "Party B, candidate 40 539305.15"
[1] "Party B, candidate 41 526151.365853659"
[1] "Party B, candidate 42 513623.952380952"
[1] "Party B, candidate 43 501679.209302326"
[1] "Party B, candidate 44 490277.409090909"
[1] "Party B, candidate 45 479382.355555556"
[1] "Party B, candidate 46 468961"
[1] "Party C, candidate 1 23343976"
[1] "Party C, candidate 2 11671988"
[1] "Party C, candidate 3 7781325.33333333"
[1] "Party C, candidate 4 5835994"
[1] "Party C, candidate 5 4668795.2"
[1] "Party C, candidate 6 3890662.66666667"
[1] "Party C, candidate 7 3334853.71428571"
[1] "Party C, candidate 8 2917997"
[1] "Party C, candidate 9 2593775.11111111"
[1] "Party C, candidate 10 2334397.6"
[1] "Party C, candidate 11 2122179.63636364"
[1] "Party C, candidate 12 1945331.33333333"
[1] "Party C, candidate 13 1795690.46153846"
[1] "Party C, candidate 14 1667426.85714286"
[1] "Party C, candidate 15 1556265.06666667"
[1] "Party C, candidate 16 1458998.5"
[1] "Party C, candidate 17 1373175.05882353"
[1] "Party C, candidate 18 1296887.55555556"
[1] "Party C, candidate 19 1228630.31578947"
[1] "Party C, candidate 20 1167198.8"
[1] "Party C, candidate 21 1111617.9047619"
[1] "Party C, candidate 22 1061089.81818182"
[1] "Party C, candidate 23 1014955.47826087"
[1] "Party C, candidate 24 972665.666666667"
[1] "Party C, candidate 25 933759.04"
[1] "Party C, candidate 26 897845.230769231"
[1] "Party C, candidate 27 864591.703703704"
[1] "Party C, candidate 28 833713.428571429"
[1] "Party C, candidate 29 804964.689655172"
[1] "Party C, candidate 30 778132.533333333"
[1] "Party C, candidate 31 753031.483870968"
[1] "Party C, candidate 32 729499.25"
[1] "Party C, candidate 33 707393.212121212"
[1] "Party C, candidate 34 686587.529411765"
[1] "Party C, candidate 35 666970.742857143"
[1] "Party C, candidate 36 648443.777777778"
[1] "Party C, candidate 37 630918.27027027"
[1] "Party C, candidate 38 614315.157894737"
[1] "Party C, candidate 39 598563.487179487"
[1] "Party C, candidate 40 583599.4"
[1] "Party C, candidate 41 569365.268292683"
[1] "Party C, candidate 42 555808.952380952"
[1] "Party C, candidate 43 542883.162790698"
[1] "Party C, candidate 44 530544.909090909"
[1] "Party C, candidate 45 518755.022222222"
[1] "Party C, candidate 46 507477.739130435"
[1] "Party C, candidate 47 496680.340425532"
[1] "Party C, candidate 48 486332.833333333"
[1] "Party C, candidate 49 476407.673469388"
[1] "Party C, candidate 50 466879.52"
[1] "Party C, candidate 51 457725.019607843"
[1] "Party C, candidate 52 448922.615384615"
[1] "Party D, candidate 1 32125207"
[1] "Party D, candidate 2 16062603.5"
[1] "Party D, candidate 3 10708402.3333333"
[1] "Party D, candidate 4 8031301.75"
[1] "Party D, candidate 5 6425041.4"
[1] "Party D, candidate 6 5354201.16666667"
[1] "Party D, candidate 7 4589315.28571429"
[1] "Party D, candidate 8 4015650.875"
[1] "Party D, candidate 9 3569467.44444444"
[1] "Party D, candidate 10 3212520.7"
[1] "Party D, candidate 11 2920473.36363636"
[1] "Party D, candidate 12 2677100.58333333"
[1] "Party D, candidate 13 2471169.76923077"
[1] "Party D, candidate 14 2294657.64285714"
[1] "Party D, candidate 15 2141680.46666667"
[1] "Party D, candidate 16 2007825.4375"
[1] "Party D, candidate 17 1889718.05882353"
[1] "Party D, candidate 18 1784733.72222222"
[1] "Party D, candidate 19 1690800.36842105"
[1] "Party D, candidate 20 1606260.35"
[1] "Party D, candidate 21 1529771.76190476"
[1] "Party D, candidate 22 1460236.68181818"
[1] "Party D, candidate 23 1396748.13043478"
[1] "Party D, candidate 24 1338550.29166667"
[1] "Party D, candidate 25 1285008.28"
[1] "Party D, candidate 26 1235584.88461538"
[1] "Party D, candidate 27 1189822.48148148"
[1] "Party D, candidate 28 1147328.82142857"
[1] "Party D, candidate 29 1107765.75862069"
[1] "Party D, candidate 30 1070840.23333333"
[1] "Party D, candidate 31 1036297"
[1] "Party D, candidate 32 1003912.71875"
[1] "Party D, candidate 33 973491.121212121"
[1] "Party D, candidate 34 944859.029411765"
[1] "Party D, candidate 35 917863.057142857"
[1] "Party D, candidate 36 892366.861111111"
[1] "Party D, candidate 37 868248.837837838"
[1] "Party D, candidate 38 845400.184210526"
[1] "Party D, candidate 39 823723.256410256"
[1] "Party D, candidate 40 803130.175"
[1] "Party D, candidate 41 783541.634146341"
[1] "Party D, candidate 42 764885.880952381"
[1] "Party D, candidate 43 747097.837209302"
[1] "Party D, candidate 44 730118.340909091"
[1] "Party D, candidate 45 713893.488888889"
[1] "Party D, candidate 46 698374.065217391"
[1] "Party D, candidate 47 683515.042553192"
[1] "Party D, candidate 48 669275.145833333"
[1] "Party D, candidate 49 655616.469387755"
[1] "Party D, candidate 50 642504.14"
[1] "Party D, candidate 51 629906.019607843"
[1] "Party D, candidate 52 617792.442307692"
[1] "Party D, candidate 53 606135.981132075"
[1] "Party D, candidate 54 594911.240740741"
[1] "Party D, candidate 55 584094.672727273"
[1] "Party D, candidate 56 573664.410714286"
[1] "Party D, candidate 57 563600.122807018"
[1] "Party D, candidate 58 553882.879310345"
[1] "Party D, candidate 59 544495.033898305"
[1] "Party D, candidate 60 535420.116666667"
[1] "Party D, candidate 61 526642.737704918"
[1] "Party D, candidate 62 518148.5"
[1] "Party D, candidate 63 509923.920634921"
[1] "Party D, candidate 64 501956.359375"
[1] "Party D, candidate 65 494233.953846154"
[1] "Party D, candidate 66 486745.560606061"
In [ ]: