Play with spatial tools on 3D cells images

Let’s play with mapping tools on non-maps data ! {rayshader} is nice on raster maps, but what about using it on segmentized plant cell ? […] I wanted to find a good reason to play with Tyler Morgan-Wall packages for 3D visualisation of raster data: {rayshader} and {rayfocus}. Using cell …

Read more

Introduction to mapping with {sf} & Co.

At the “Rencontres R 2018” in Rennes, I proposed a brief introduction to mapping using the recent {sf} package and some other interesting packages. This blog post is an extended version of my presentation allowing me to share the code of the different maps that appeared on it. It’s still a brief …

Read more

Draw maps like paintings

On the Grrr Slack, a mutual-aid Slack on R for French speaking people, Thomas Vroylandt showed the following maps asking how this could be done using {ggplot2} : EDIT : This maps was originally presented on visionscarto.net with drawings by Agnès Stienne […] As of today (2018-04-18): …

Read more

Spatial correlation between rasters

In this blog article, I propose a way to look at the spatial repartition of correlation between two rasters. For your own reason, you may want to know the correlation between rasters, but a unique value issued from fonction cor is not enough. You would like to know if there are variations of …

Read more

Enable code folding in bookdown and blogdown

Some time ago, I answered a question on stackoverflow to make code folding working with bookdown. Although this answer works, I was not totally satisfied with the behavior of the “Show/Hide Global” button. Today, I finally made it work properly ! I did “reverse engineering” to find what worked in …

Read more

Spatial interpolation on Earth as a 3D sphere

Earth map is usually presented flat. Geographical coordinates usually go from -180° to +180°. Spatial interpolations using coordinates may be tricky as -180° is equal to +180°. Here I propose a way to realize spatial interpolations on Earth as a sphere and then map the outputs in 3D using rgl. The …

Read more

Translation of rmarkdown documents using a data frame

In my post “Rmarkdown conditional chunks to create multilingual pdf and html with images”, I proposed a way to create a rmarkdown document to be printed in two different languages. If you deal with more than two languages, your document may become difficult to read. Moreover, if you work with …

Read more

SDMSelect: Cross-validation model selection and species distribution mapping

I decided to transform into a R package some R-scripts I have been using for years for my studies with species distribution modelling. I know it could be improved in many ways, but this v0.1 works as is. Please be kind for my first package ! And remember that it is a quick compilation of different …

Read more

Polygons tint band with leaflet and simple feature (library sf)

Stackoverflow is again a source of inspiration. I found this question on tint bands in leaflet, not related to R originally but I though I could answer it with R easily. This is also a good one for me to play with this new simple feature library sf and use it with leaflet. My simple solution is to …

Read more

How to fill a hatched area polygon with holes in leaflet with R

Drawing polygons filled with a hatched background is quite easy with classical plot in R. This only requires to define density and angle parameters of polygon function. SpatialPolygons from library sp also uses this polygon function. However, if you want to draw a hatched area of a SpatialPolygons …

Read more

Rmarkdown conditional chunks to create multilingual pdf and html with images

In the upper output files, I list some of the tips I have to use to make this work and some bonus: […] I will modify this list if I face new difficulties or I find better ways to do things. […] The complete list of tips can be seen on the following web pages (embedded in iframes). Rmd …

Read more

A nice RShiny On/Off switch button

RShiny input controls have a nice design that allows to produce nice web interfaces in a very simple way, but the ‘checkboxInput()’ button is really boring compared to its friends…I was looking for a nice way to present a On/Off (or True/False) switch button in my shiny interfaces but I did not find …

Read more

Bayesian life cycle model: OpenBUGS code

The OpenBUGS code presented below is the additional material of a publication. This is the life cycle model of a marine species (the sole in the Eastern Channel). The Bayesian hierarchical model incorporates indices of juvenile spatialized abundance, larval dispersion, adult abundance indices and …

Read more