new_hope <-c(460.998, 314.4)
empire_strikes <- c(290.475, 247.900)
return_jedi <- c(309.306, 165.8)
region <- c("US", "non-US")
titles <- c("A New Hope", "The Empire Strikes Back", "Return of the Jedi")
starWars <- rbind(new_hope, empire_strikes, return_jedi)
starWars
## [,1] [,2]
## new_hope 460.998 314.4
## empire_strikes 290.475 247.9
## return_jedi 309.306 165.8
colnames(starWars) <- region
row.names(starWars) <- titles
starWars
## US non-US
## A New Hope 460.998 314.4
## The Empire Strikes Back 290.475 247.9
## Return of the Jedi 309.306 165.8
world <- rowSums(starWars)
world
## A New Hope The Empire Strikes Back Return of the Jedi
## 775.398 538.375 475.106
starWars <- cbind(starWars, world)
starWars
## US non-US world
## A New Hope 460.998 314.4 775.398
## The Empire Strikes Back 290.475 247.9 538.375
## Return of the Jedi 309.306 165.8 475.106
phantom_menace <- c(474.5, 552.5)
attack_clones <- c(310.7, 338.7)
revenge_sith <- c(380.3, 468.5)
titles2 <- c("The Phantom Menace", "Attack of the Clones", "Revenge of the Sith")
starWars2 <- rbind(phantom_menace, attack_clones, revenge_sith)
colnames(starWars2) <- region
row.names(starWars2) <- titles2
world <- rowSums(starWars2)
starWars2 <- cbind(starWars2, world)
starWars2
## US non-US world
## The Phantom Menace 474.5 552.5 1027.0
## Attack of the Clones 310.7 338.7 649.4
## Revenge of the Sith 380.3 468.5 848.8
allStarWars <- rbind(starWars, starWars2)
allStarWars
## US non-US world
## A New Hope 460.998 314.4 775.398
## The Empire Strikes Back 290.475 247.9 538.375
## Return of the Jedi 309.306 165.8 475.106
## The Phantom Menace 474.500 552.5 1027.000
## Attack of the Clones 310.700 338.7 649.400
## Revenge of the Sith 380.300 468.5 848.800
colSums(allStarWars)
## US non-US world
## 2226.279 2087.800 4314.079
The total non-US revenue for all movies is $2087.800 (in millions).