Hi all. I'm flying to Boston in the next few days to participate at the AAG conference.
I'm very excited about this because I'll participate in a panel with Susan Fainstein and others. In the panel, I'll be talking about transportation equity and accessibility in the just city. My talk will be based on the 1st paper of my thesis and some future research questions on the topic.
I will also be at the session 3650 presenting the preliminary results of the 2nd paper of my thesis, where I analyze the distributional impacts of the transport legacy of recent mega-events in Rio de Janeiro (Brazil) in terms of their impacts in inequalities in access to opportunities. The paper combines population census data with geolocated time-tables in GTFS format in order to conduct a before-and-after comparison of Rio's public transport system between 2014 and 2017. The paper examines how the newly implemented transport investments have reconfigured the catchment areas of the Olympic sports venues and of healthcare facilities by public transport and walking, looking specifically at how the population composition within those areas has changed in terms of income categories.
The other papers of my PhD will focus on inequalities in accessibility to employment and educational opportunities, adding some new elements regarding methods and theoretical discussions. More info to come as I make progress on the research.
ps. In case you're in Boston next week and would like grab a coffee beer, drop me line or a tweet.
In 1900, W.E.B. Du Bois created these beautiful data visualizations for the Paris Exposition Universelle to show the economic and social progress of African Americans since emancipation (via Michal Migurski)
I've created this map after a couple of hours procrastinating testing the gganimate package in R, which makes it ridiculously simple to create this type animation in .gif or .mp4 format.
The map shows how the life expectancy of each country has changed from 1950 to 2015 and how it is expected to increase up to 2100. It looks better in full screen, but it's still a bit clunky.
I've also created a gist that shows how you can create this map yourself:
This gist shows how to create an animated world map of life expectancy using R. The data comes the UN World Population Prospects, 2015 Revision, and it brings life expectancy data from 1950 untill 2015 and projeceted data up to 2100. Thanks Topi Tjukanov, who reminded me of the UN DESA data portal, where you can find this dataset and many others
The idea is to use open data to create a GIF, much like the ones created by Aron Strandberg but his maps look much nicer. The output of this script is a map like this one:
Now diving into the code. First, let's load the necessary libraries and get the data. As of this writing, the current version of gganimate has a bug that messes the aesthetics of the .gif file. As a temporary solution, I've intalled an older version of the package, as recommended by the author of the gganimate, David Robinson.
The dataset comes in an Excel file. One spreadsheet brings life expectancy data for years before 2015 and another spreadsheet brings projected life expectancy up to 2100.
Now we need to read and merge these two datasets. We are also going to use country codes (iso3) instead of country names names to amke it easier latter to join the life expect. info with spatial data. This can be done using the countrycode library, recommended by Noam Ross
# Read historic data
df1 <- read_excel( path= "LIFE_EXPECTANCY_0_BOTH_SEXES.xls", sheet="ESTIMATES", skip = 16)
# Read projected data
df2 <- read_excel( path= "LIFE_EXPECTANCY_0_BOTH_SEXES.xls", sheet="MEDIUM VARIANT", skip = 16)
# Merge historic and projected data
setDT(df2)[, Notes := NULL][, Variant := NULL]
df <- left_join(df1, df2, by=c("Index", "Major area, region, country or area *", "Country code"))
setDT(df)
# change name of column
colnames(df)[3] <- c("country")
# drop first 14 rows with information aggregated for continents etc
df <- df[-c(1:14),]
# get standard country codes for latter merge with spatial data
df[, country_iso3c := countrycode(country, 'country.name', 'iso3c')]
# quick note: these UN data don't bring life expectancy data for Greenland, Kosovo, San Marino, Somaliland and Taiwan.
Note that the data is organized in wide format, where each year is a separete column. In order to make our animated map, we are going to reshape the data to long format, piling up all observations. melt{data.table} makes this task really simple and fast.
# data in wide format
head(df)
#> Index Variant country Notes Country code 1950-1955 1955-1960 1960-1965 ...
#> 1: 15 Estimates Burundi NA 108 39.031 40.529 42.036 ...
#> 2: 16 Estimates Comoros NA 174 38.720 40.465 42.472 ...
#> 3: 17 Estimates Djibouti NA 262 41.038 42.949 45.176 ...
#> 4: 18 Estimates Eritrea NA 232 35.840 36.846 37.983 ...
#> 5: 19 Estimates Ethiopia NA 231 34.080 36.675 40.080 ...
# Reshape to long format
# get name of columns with years of reference
year_cols <- colnames(df)[6:35]
# Reshape data
dt <- melt(df, id.vars = c("country", "country_iso3c"),
measure.vars = year_cols,
variable.name= "year",
value.name= "life_expect")
# data in long format
head(dt)
#> country country_iso3c year life_expect
#> 1: Burundi BDI 1950-1955 39.031
#> 2: Comoros COM 1950-1955 38.720
#> 3: Djibouti DJI 1950-1955 41.038
#> 4: Eritrea ERI 1950-1955 35.840
#> 5: Ethiopia ETH 1950-1955 34.080
#> 6: ... ... ... ...
# get Min and Max values of life expectancy
vmax <- max(dt$life_expect, na.rm=T)
vmin <- min(dt$life_expect, na.rm=T)
2. Get Spatial data
# get world map
wmap <- getMap(resolution="low")
# small edits
wmap <- spTransform(wmap, CRS("+proj=robin")) # reproject
wmap <- subset(wmap, !(NAME %like% "Antar")) # Remove Antarctica
We also need to get a pair of coordinates for each country, which will indicate on the map where we will place the tex with life expectancy values.
I adopted a simple solution using the centroids of each country. This is far from perfct because some strings will look a bit misaligned.
See for example Norway, Canada, Peru or Chile. If you know a simple way to fix this, I would be glad to hear from you!
# get centroids of countries
centroids <- gCentroid( wmap , byid=TRUE, id = wmap@data$ISO3)
centroids <- data.frame(centroids)
setDT(centroids, keep.rownames = TRUE)[]
setnames(centroids, "rn", "country_iso3c")
Now we just need to join the life expectancy data with the world map, and...
# join data to map
wmap_df <- fortify(wmap, region = "ISO3")
wmap_df <- left_join(wmap_df, dt, by = c('id'='country_iso3c')) # data
wmap_df <- left_join(wmap_df, centroids, by = c('id'='country_iso3c')) # centroids
3. Plot and save gif
# plot
o <- ggplot(data=wmap_df) +
geom_polygon(aes(x = long, y = lat, group = group, fill=life_expect, frame = year), color="gray90") +
geom_text(aes(x = x, y = y, label = round(life_expect), frame = year), hjust=0, vjust=0, size = 4.5) +
scale_fill_viridis(name="Life Expectancy", begin = 0, end = 1, limits = c(vmin,vmax), na.value="gray99") +
theme_void() +
guides(fill = guide_colorbar(title.position = "top")) +
labs(title = "Life Expectancy, ") +
labs(caption = "Map by Rafael H M Pereira, @UrbanDemog\nsource: UN World Population Prospects 2015 Revision") +
theme(plot.title = element_text(hjust = 0.5, vjust = 0.05, size=25)) +
theme(plot.caption = element_text(hjust = 0, color="gray40", size=15)) +
coord_cartesian(xlim = c(-11807982, 14807978)) +
theme( legend.position = c(.5, .08),
legend.direction = "horizontal",
legend.title.align = 0,
legend.key.size = unit(1.3, "cm"),
legend.title=element_text(size=17),
legend.text=element_text(size=13) )
# save gif
gg_animate(o, "output4020_old.gif", title_frame =T,
ani.width=1600, ani.height=820, dpi=800, interval = .4)
As you can see, the plot is still a bit clunky with too many numbers, poor resolution, and legend too small. I will be updating this code in the future as I improve the map. If you have any suggestion to improve the map or the code, please feel free to get in touch!
The special issue intends to close the gap. Building on a set of original papers, it seeks to establish an account of the state-of-the-art of which concepts and methods are applied for what topics/aspects of informality in urban transport, an in-depth review of selected specific methods and their application in the field and the identification of their strengths and limitations, and the identification of lessons and directions for future research on the subject. The Symposium positions a set of overarching questions:
How and how well do existing concepts and methods capture the phenomenon of informality in urban transport? What are they missing out? What is the promise of new /emerging technology in data gathering? What can be won by combining methods?
What are the strengths and the limitations of approaches in specific case study contexts but also across cases and contexts?
How can case study and experiential-based methodologies inform network-scale analyses in more conventional transport geography?
What methods help to transfer knowledge from the research community across to policy making?
Here is a very interesting project that aims towards building agent based models to simulate cities and the impacts of policies on them. The project is available on GitHub. Kudos to the authors, who are all on Twitter btw Francis Tseng, Fei Liu and Bernardo Furtado.
The model presented in this paper experiments with a comprehensive simulant agent in order to provide an exploratory platform in which simulation modelers may try alternative scenarios and participation in policy decision-making. The framework is built in a computationally distributed online format in which users can join in and visually explore the results. Modeled activity involves daily routine errands, such as shopping, visiting the doctor or engaging in the labor market. Further, agents make everyday decisions based on individual behavioral attributes and minimal requirements, according to social and contagion networks. Fully developed firms and governments are also included in the model allowing for taxes collection, production decisions, bankruptcy and change in ownership. The contributions to the literature are multifold. They include (a) a comprehensive model with detailing of the agents and firms' activities and processes and original use of simultaneously (b) reinforcement learning for firm pricing and demand allocation; (c) social contagion for disease spreading and social network for hiring opportunities; and (d) Bayesian networks for demographic-like generation of agents. All of that within a (e) visually rich environment and multiple use of databases. Hence, the model provides a comprehensive framework from where interactions among citizens, firms and governments can be easily explored allowing for learning and visualization of policies and scenarios.
A passage of the book "The Just City", where Susan Fainstein quotes D. Harvey to draw attention to how the idea of "Community" is a double-edged value. At the same time a community provides its members with social support, it is also exclusionary.
" 'Community' has ever been one of the key sites of social control and surveillance, bordering on overt social repression. Well-founded communities often exclude, define themselves against others, erect all sorts of keep-out signs (if not tangible walls) .... As a consequence, community has often been a barrier to rather than facilitator of progressive social change, and much of the populist migration out of villages (both rural and urban) arose precisely because they were oppressive to the human spirit and otiose as a form of sociopolitical organization". (David Harvey, 1997)
A short video about Tower of David, possibly the tallest slum today, located in Caracas, Venezuelza. (Thanks Telmo Ribeiro and Lucas Mation for the pointer)
And a short video about Kowloon Walled City of Hong Kong, which was of the most densely populated slums in the world until being demolished in 1994.
The United Nations has declared that the number of displaced people has surged to unprecedented numbers. But a close examination of data reveals that current flows are just as high as in they were in the 1990s. Because it is difficult to track refugees, official data and statistics must be handled with care, and yet misleading reports are creating unjustified fears about refugees.