https://github.com/openwashdata/universityrankingafrica
https://github.com/openwashdata/universityrankingafrica
africa openwashdata r university-ranking
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/openwashdata/universityrankingafrica
- Owner: openwashdata
- License: cc-by-4.0
- Created: 2023-12-04T15:13:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-14T16:40:33.000Z (over 2 years ago)
- Last Synced: 2025-09-05T03:59:56.140Z (9 months ago)
- Topics: africa, openwashdata, r, university-ranking
- Language: R
- Homepage: https://openwashdata.github.io/universityrankingafrica/
- Size: 1.55 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE.md
- Citation: CITATION.cff
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
message = FALSE,
warning = FALSE,
fig.retina = 2,
fig.align = 'center'
)
library(tidyverse)
library(epoxy)
library(universityrankingafrica)
library(sf)
library(rnaturalearth)
```
# universityrankingafrica
[](https://github.com/openwashdata/universityrankingafrica/actions/workflows/R-CMD-check.yaml)
[](https://zenodo.org/doi/10.5281/zenodo.10284864)
This packages combines data collected as part of an MSc. Thesis Project. The goal of this project was to build an openly accessible database with data from the top ranked universities of each African country. The project is supported by the Global Health Engineering group at ETH Zurich, Switzerland.
```{r, echo=FALSE}
top_ranked_per_country <- african_countries |>
select(countries, best_uni_rank)
world <- ne_countries(scale = "medium", returnclass = "sf")
africa_map <- left_join(world,
top_ranked_per_country, by = c("name_long" = "countries")) |>
filter(continent == "Africa")
ggplot() +
theme_void() +
geom_sf(data = africa_map, aes(fill = best_uni_rank), color = "white", lwd = 0) +
scale_fill_gradientn(name = paste("Rank Africa", "\n(out of 2'064)"),
trans = "log",
labels = scales::label_number(accuracy = 1),
colors = c("#2E8B57","#9DBF9E", "#FCB97D", "#A84268"),
na.value = "grey80",
guide = guide_colorbar(title.position = "top", title.vjust = 1.5)) +
labs(title = "Top-Ranked Universities in Africa",
subtitle = "Comparison of the Highest-Ranked University in each African Country",
caption = "Source: Ranking Web of Universities (https://www.webometrics.info/en/Africa)") +
theme(legend.position = c(-0.1, 0.3), legend.direction = "horizontal",
plot.title = element_text(size = 20, hjust = 0, vjust = 0),
plot.subtitle = element_text(size = 10, hjust = 0, vjust = 0.5),
plot.caption = element_text(size = 10, color = "darkgray", hjust = -0.6)) +
coord_sf(ylim = c(-40, 40))
```
## Installation
You can install the development version of universityrankingafrica from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("openwashdata/universityrankingafrica")
```
Alternatively, you can download the individual dataset as a CSV or XLSX
file from the table below.
```{r, echo=FALSE}
extdata_path <- "https://github.com/openwashdata/universityrankingafrica/raw/main/inst/extdata/"
read_csv("data-raw/dictionary.csv") |>
distinct(file_name) |>
mutate(file_name = str_remove(file_name, ".rda")) |>
rename(dataset = file_name) |>
mutate(
CSV = paste0("[Download CSV](", extdata_path, dataset, ".csv)"),
XLSX = paste0("[Download XLSX](", extdata_path, dataset, ".xlsx)")
) |>
knitr::kable()
```
## MSc. Thesis Project
### Description
Data from institutional and national levels was combined into a dataset to provide a comprehensive characterization of the top ranked Universities of every African country. This was done to demonstrate the correlation of certain attributes with the academic ranking performance. The dataset also highlights the difficulties of accessing data from many African Universities online.
### Research Question
Which attributes of an African university correlate with its performance in an international ranking?
### Data
The data was collected between April and June 2023 using only the official websites of the Universities. The ranking data originates from the [Ranking Web of Universities](https://www.webometrics.info/en/Africa). It's worth noting that while the World Ranking comprises 11'997 universities, the African Ranking accounts for 2'064 universities. For the data collection at hand, it was decided to only consider the 3 (at most) highest ranked universities of each African country. The gathered data offers interesting insights into the African academic landscape, mostly
through the process of combing through more than 140 websites in the search for information.
Generally, this data collection process gets more and more difficult the further down the ranking
performance goes: Navigation is more confusing and useful information scarcer. Assisting institutions
in improving the quality of their web contents could be one possible avenue for cooperation with
African universities in the future.
The package provides access to two data sets.
```{r}
library(universityrankingafrica)
```
```{epoxy}
The `ranking` data set has {ncol(ranking)} variables and {nrow(ranking)} observations. For an overview of the variable names, see the following table.
```
```{r, eval=FALSE}
ranking
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "ranking.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
```{epoxy}
The `african_countries` data set has {ncol(african_countries)} variables and {nrow(african_countries)} observations. For an overview of the variable names, see the following table.
```
```{r, eval=FALSE}
african_countries
```
```{r, echo=FALSE}
readr::read_csv("data-raw/dictionary.csv") |>
dplyr::filter(file_name == "african_countries.rda") |>
dplyr::select(variable_name:description) |>
knitr::kable()
```
## Example
### 1) Mapping Countries with the Best-Ranked Universities
The code below demonstrates how to create a map in R that highlights countries hosting the top-ranked universities. This method involves picking the best university in each country and associating its rank with that specific country.
```{r}
library(universityrankingafrica)
library(tidyverse)
library(sf)
library(rnaturalearth)
top_ranked_per_country <- african_countries |>
select(countries, best_uni_rank)
world <- ne_countries(scale = "medium", returnclass = "sf")
africa_map <- left_join(world,
top_ranked_per_country, by = c("name_long" = "countries")) |>
filter(continent == "Africa")
ggplot() +
theme_void() +
geom_sf(data = africa_map, aes(fill = best_uni_rank), color = "white", lwd = 0) +
scale_fill_gradientn(name = paste("Rank Africa", "\n(out of 2'064)"),
trans = "log",
labels = scales::label_number(accuracy = 1),
colors = c("#2E8B57","#9DBF9E", "#FCB97D", "#A84268"),
na.value = "grey80",
guide = guide_colorbar(title.position = "top", title.vjust = 1.5)) +
labs(title = "Top-Ranked Universities in Africa",
subtitle = "Comparison of the Highest-Ranked University in each African Country",
caption = "Source: Ranking Web of Universities (https://www.webometrics.info/en/Africa)") +
theme(legend.position = c(-0.1, 0.3), legend.direction = "horizontal",
plot.title = element_text(size = 20, hjust = 0, vjust = 0),
plot.subtitle = element_text(size = 10, hjust = 0, vjust = 0.5),
plot.caption = element_text(size = 10, color = "darkgray", hjust = -0.6)) +
coord_sf(ylim = c(-40, 40))
```
### 2) Exploring Colonial's Legacy on African University Ranking
This analysis investigates whether a correlation exists between the colonial power that previously governed African nations and their current university rankings.
```{r}
library(universityrankingafrica)
library(tidyverse)
library(broom)
data <- ranking |>
filter(colonial_power %in% c("United Kingdom", "France", "Belgium", "Italy", "Portugal"))
# Create a scatter plot
ggplot(data, aes(x = colonial_power, y = rank_africa)) +
geom_point() +
labs(x = "Colonial Power at Independence", y = "Africa Rank") +
ggtitle("University Ranking in Africa vs Colonial Power at Independence")
# Perform linear regression
model <- lm(rank_africa ~ colonial_power, data = data)
print(tidy(model))
print(summary(model)$r.squared)
```
#### Interpretation
The model doesn't provide strong evidence that the specific colonial powers (France, Italy, Portugal, United Kingdom) significantly predict the university rankings in Africa based on their p-values which are greater than conventional thresholds like 0.05.. The low R-squared value indicates that the model might not explain much of the variability in the university rankings, suggesting that factors beyond colonial power might influence these rankings significantly.
## License
Data are available as
[CC-BY](https://github.com/openwashdata/universityrankingafrica/LICENSE.md).
## Citation
To cite this package, please use:
```{r}
citation("universityrankingafrica")
```