RSSAmplifier

Blog

Dr Dominic Royé

This is my blog where I practice sharing my curiosity about R, particularly, the world of cartography and data visualization. I take this opportunity to invite you to participate in the [#30DayChartChallenge](https://bsky.app/profile/30daychartchall.bsky.social).

dominicroye.github.ioRSS feed ↗20 posts

Latest posts

A data-driven normal for the Spain temperature chart

--> --> --> For the past few years I’ve kept this chart running: the daily mean temperature in Spain against its climatological normal, with the anomaly shaded in red (above normal) and blue (below). Whenever I want to know “is this heatwave or cold snap actually unusual, or does it just feel that way”, this is the chart I reach for, a line, not a column, because temperature is an interval scale…

Map projections: a practical guide to common mistakes and how to fix them

--> --> --> If you have spent any time reading scientific journals, news outlets, or even peer-reviewed climate research, you have almost certainly encountered a world map stretched beyond recognition, with continents bloated at the poles, Greenland looming as large as Africa, or a country’s area visually misrepresented because of an inappropriate coordinate reference system. Map projections are…

Downscaling solar radiation in the Canary Islands with GAM

--> --> --> I’ve been meaning to write a post on how we can push interpolation and downscaling— beyond the usual tools like linear regression or kriging when dealing with climate data. This post illustrates a statistical downscaling workflow for monthly radiation over the Canary Islands using a Generalized Additive Model (GAM). We start from a coarse ~5km signal, learn its relationship with…

Mapping building use with a hexagonal grid

--> --> --> I needed a compact way to show the composition of building uses across Spain without pixel‑level clutter. We will aggregate 100 m building‑use rasters to a 20 km hexagonal grid and visualize the mix of agricultural, industrial, and commercial uses with overlapping proportional symbols blended by multiplication. The Canary Islands are shown as an inset. Tip Hexagons reduce directional…

Broken Chart: discover 9 visualization alternatives

--> --> --> I’ve wanted to write a post for a while about a graph that the Spanish Ministry for Ecological Transition publishes every month, summarizing the average monthly temperature in Spain. If we look closely, there is a misuse of the geometry type to present the temperature variable. In this specific case, columns have always a baseline at 0. The issue here is that 0 in degrees Celsius…

Always normalize your data

--> --> --> I recently came across a map from the National Atlas of Spain showing the number of libraries by municipality. However, one thing directly caught my attention. There’s a saying that many maps show only the population, and this seems to be the case here. The map does not provide any remarkable information about the distribution of libraries; it merely shows where the most people live.…

Map of circles grouped in multiple locations

--> --> --> In my first post of 2024, which unfortunately has not been possible before April, I will explain how we can group in the same location several proportional circles. In 2022 I was looking for how to represent the number of heat wave days according to the degree of severity in Spain. I found the solution using the circle packing which is also used in the Dorling cartogram. Packages…

Inserted maps with ggplot2

--> --> --> Today I present a short post on how we can position an outermost territory near the main map or insert an orientation map. In this example we use the typical map of Spain where the Canary Islands are located in the southwest of the peninsula. Packages Package Description tidyverse Collection of packages (visualization, manipulation): ggplot2, dplyr, purrr, etc. mapSpain Administrative…

Tomorrow’s weather

--> --> --> A while back I saw Chris Campbell’s global maps from the Financial Times like in this Tweet and I thought I needed to do it in R. In this first post of 2023 well see how we can access the GFS (Global Forecast System) data and visualize it with {ggplot2} , even though there are several ways, in this case we use the Google Earth Engine API via the {rgee} package for accessing the GFS…

Hillshade effects

--> --> --> It is very common to see relief maps with shadow effects, also known as ‘hillshade’, which generates visual depth. How can we create these effects in R and how to include them in ggplot2? Packages Package Description tidyverse Collection of packages (visualization, manipulation): ggplot2, dplyr, purrr, etc. sf Simple Feature: import, export and manipulate vector data elevatr Access to…

Use of multidimensional spatial data

--> --> --> Initial considerations Space-time information is vital in many disciplines, especially in climatology or meteorology, and this makes it necessary to have a format that allows a multidimensional structure. It is also important that this format has a high degree of interchange compatibility and can store a large number of data. These characteristics led to the development of the open…

Visualize the day-night cycle on a world map

--> --> --> In April of this year, I made an animation of the 24-hour average temperature of January 2020, also showing the day-night cycle. My biggest problem was finding a way to project correctly the area at night without breaking the geometry. The easiest solution I found was rasterising the night polygon and then reprojecting it. Indeed, a vector approach could be used, but I have preferred…

Climate circles

--> --> --> The climate of a place is usually presented through climographs that combine monthly precipitation and temperature in a single chart. However, it is also interesting to visualize the climate on a daily scale showing the thermal amplitude and the daily average temperature. To do this, the averages for each day of the year of daily minimums, maximums and means are calculated. The annual…

Firefly cartography

--> --> --> Cartography firefly Firefly maps are promoted and described by John Nelson who published a post in 2016 about its characteristics. However, these types of maps are linked to ArcGIS, which has led me to try to recreate them in R. The recent ggplot2 extension ggshadow facilitates the creation of this cartographic style. It is characterized by three elements 1) a dark and unsaturated…

Bivariate dasymetric map

--> --> --> Initial considerations A disadvantage of choropleth maps is that they tend to distort the relationship between the true underlying geography and the represented variable. It is because the administrative divisions do not usually coincide with the geographical reality where people live. Besides, large areas appear to have a weight that they do not really have because of sparsely…

A heatmap as calendar

--> --> --> Recently I was looking for a visual representation to show the daily changes of temperature, precipitation and wind in an application xeo81.shinyapps.io/MeteoExtremosGalicia (in Spanish), which led me to use a heatmap in the form of a calendar. The shiny application is updated every four hours with new data showing calendars for each weather station. The heatmap as a calendar allows…

Climate animation of maximum temperatures

--> --> --> In the field of data visualization, the animation of spatial data in its temporal dimension can show fascinating changes and patterns. As a result of one of the last publications in the social networks that I have made, I was asked to make a post about how I created it. Well, here we go to start with an example of data from mainland Spain. You can find more animations in the graphics…

River flow directions

--> --> --> I recently created a visualization of the distribution of river flow directions and also of coastal orientations. Following its publication in social networks, I was asked to make a post about how I did it. Well, here we go to start with an example of rivers, coastal orientation is somewhat more complex. I did the same for a selection of European rivers here in this. However,…

Visualize climate anomalies

--> --> --> When we visualize precipitation and temperature anomalies, we simply use time series as bar graph indicating negative and positive values in red and blue. However, in order to have a better overview we need both anomalies in a single graph. In this way we could more easly answer the question of whether a particular season or month was dry-warm or wet-cold, and even compare these…

Geographic distance

--> --> --> The first post of this year 2020, I will dedicate to a question that I was recently asked. The question was how to calculate the shortest distance between different points and how to know which is the closest point. When we work with spatial data in R, currently the easiest thing is to use the sf package in combination with the tidyverse collection of packages. We also use the units…