ggplot2

Combining plots in R

Masumbuko Semba
The ggplot2 package doesn’t provide a function to arrange multiple plots in a single figure (Wickham 2016). Still, some packages allow combining multiple plots into a single figure with custom layouts, width, and height, such as cowplot (Wilke 2018), gridExtra, and patchwork (Pedersen 2020). In this post we are going to use several packages, let’us load them in our session require(tidyverse) require(patchwork) require(cowplot) Sample datasets # tuna = tibble( # tl = runif(n = 120, min = 30, max = 120), # seasons = rep(c("Northeast", "Southeast", "Inter"), each = 40) # ) tuna = tibble( tl = c(rnorm(n = 40, mean = 80, sd = 30), rnorm(n = 40, mean = 61,10), rnorm(n = 40, mean = 96, 25)), seasons = rep(c("Northeast", "Southeast", "Inter"), each = 40) ) ridges = tuna %>% ggplot() + ggridges::geom_density_ridges(aes(x = tl, y = seasons, fill = seasons), position = "identity", alpha = .

Forecasting Rising Temperature with prophet package in R

Masumbuko Semba
Time-series analysis aims to analyse and learn the temporal behaviour of datasets over a period. Examples include the investigation of long-term records of temperature , sea-level fluctuations, the effect of the El Niño/Southern Oscillation on tropical rainfall, and surface current influences on distribution of temperature and rainfall. Th e temporal pattern of a sequence of events in a time series data can be either random, clustered, cyclic, or chaotic.

Access altitude data and plot topograhy in R

Masumbuko Semba
Elevation data is used for a wide array of applications, including, for example, visualization, hydrology, and ecological modelling. There are several sources for digital elevation models such as the Shuttle Radar Topography Mission (SRTM), the USGS National Elevation Dataset (NED), Global DEM (GDEM), and others. Each of these DEMs has pros and cons for their use. Prior to its closure in January of 2018, Mapzen combined several of these sources to create a synthesis elevation product that utilizes the best available elevation data for a given region at given zoom level.

Create Artist Map of Downstreet Dar es Salaam with R and Open Street Data

Masumbuko Semba
OpenStreetMap (OSM) is a collaborative project to create a free editable geographic database of the world. The geodata underlying the maps is considered the primary output of the project (Wikipedia contributors 2021). OpenStreetMap was born in 2004 in the UK, at a time when map data sources were controlled by private and governmental players. They were expensive and highly restrictive which made them accessible only by large companies.

Analyse questionnaire and surveys in R

Masumbuko Semba
Introduction This post offers some technique on how to analyse data from a surveys and questionnaires in R, provides tips on visualizing survey data, and exemplifies how survey and questionnaire data can be analyzed. Questionnaires and surveys are widely used in research and thus one of the most common research designs. Questionnaires elicit three types of data: Factual Behavioral Attitudinal While factual and behavioral questions are about what the respondent is and does, attitudinal questions tap into what the respondent thinks or feels.