tpemartin / 110-1-r4ds-main

MIT License
3 stars 73 forks source link

Exercise 4.19 Obtain wdi object #58

Open tpemartin opened 2 years ago

tpemartin commented 2 years ago

Exercise 4.19 Obtain wdi object from exercise 5 of the Exercise section. The following questions focus only on year 2000 (which means all the following questions implicitly start with the expression, for those from year 2000.)

  1. How many observations are there?

  2. The followings are iso2c values that represent a region but not a country. Take a subsample that excludes those region (i.e. a subsample that consists of countries),

iso2c_nonCountry <- c('ZH','ZI','1A','S3','B8','V2','Z4','4E','T4','XC','Z7','7E','T7','EU','F1','XE','XD','XF','ZT','XH','XI','XG','V3','ZJ','XJ','T2','XL','XO','XM','XN','ZQ','XQ','T3','XP','XU','XY','OE','S4','S2','V4','V1','S1','8S','T5','ZG','ZF','T6','XT','1W')

The following questions focus on the subsample.

3, How many countries are there?

  1. Regarding Energy use (kg of oil equivalent per capita). Complete the following summary:

For Energy use (kg of oil equivalent per capita), there are … observations with … missing values. Excluding missing values, the range of energy use is between … and … kg/per capita of oil equivalent with median usage of … and mean usage of … .

The wdi$data’s feature meanings (other than iso2c, year, and country) can be found at:

browseURL(wdi$meta)
raychiu135 commented 2 years ago

https://github.com/raychiu135/110-1-r4ds-main/blob/018e8ded873cdb8eb8c286f8c9fde0a8f3b98c65/exercise_4.19.rmd#L2

linttttt commented 2 years ago

https://github.com/linttttt/110-1-r4ds-main/blob/0951300b2fb55934d5fb950cbb583cc41ccb9e19/studyCH4(EX).Rmd#L371