-
Notifications
You must be signed in to change notification settings - Fork 0
/
First Draft.Rhistory
32 lines (27 loc) · 1.08 KB
/
First Draft.Rhistory
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
setwd(<path to "Population of the World")
library(raster)
library(rgdal)
# CountryAdminArea is the total land area for each country in square kilometers
CountryAdminArea <- raster("mastergrid_countryarea_1km.tif")
CountryAdminArea
plot(CountryAdminArea)
# CountryCodeID is the 3-digit standardized ISO code for each country
CountryCodeID <- raster("mastergrid_countrycodeID_1km.tif")
CountryCodeID
plot(CountryCodeID)
plot(CountryCodeID, main="Countries of the World")
travelTime <- raster("mastergrid_traveltime50k_1km.tif")
travelTime
plot(travelTime, main="Travel Time to the Nearest City")
population2015 <- raster("gpw-v4-population-density_2015.tif")
population2015
plot(population2015, main="Gridded Population of the World 2015")
minValue(population2015)
maxValue(population2015)
hist(population2015, main="Population of the World")
aggregate_pop <- aggregate(population2015, fact=120, fun=sum)
aggregate_pop
hist(aggregate_pop, main="Population of the World for 1degree by 1degree long-lat")
summary(aggregat_pop)
summary(log(aggregat_pop, base = 10))
hist(log(aggregat_pop, base = 10))