Open access journals around the World

It is easy to say that there is an increasing interest in publishing in open access journals. There are now more and more peer-reviewed open access journals where scientific research can be disseminated. That is why, as an academic, I recently decided to only review articles that are going to be published in open access journals. I will also strongly encourage the publication of my future articles in open access journals when I am the first author. [Read More]

Removing borders around ggplot2 graphs

Recently I was participating in the 30DayMapChallenge where people were invited to make a map based on a different daily theme for one whole month. Announcing #30DayMapChallenge in November 2019! Create a map each day of the month with the following themes 🌍🌎🌏 No restriction on tools. All maps should be created by you. Doing less than 30 maps is fine. #gischat #geography #cartography #dataviz pic.twitter.com/6Go4VFWcJB — Topi Tjukanov (@tjukanov) October 25, 2019 When making a geographical map, or any other visualization where I wanted to use a forced coordinate system), choosing the right aspect ratio to save my graphics has always been challenging. [Read More]

Visualizing the decrease of Artic sea ice extent

Arctic sea ice extent It is well known that the Arctic sea ice extent is decreasing at an increasing pace. As stated by the National Snow & Ice Data Center: According to scientific measurements, both the thickness and extent of summer sea ice in the Arctic have shown a dramatic decline over the past thirty years. This is consistent with observations of a warming Arctic. Thanks to the NSIDC, their data is available for download. [Read More]

Analyzing the programming languages used in R packages

It is easy to integrate other programming languages withing R. For instance, Rcpp and reticulate can be used to interface R with C++ and Python. In this post, I am analyzing the programming languages used in the R packages published on CRAN. I have downloaded all published packages and used cloc (v1.82) to count the number of lines of code in each package. Disclaimer: cloc does not only count line of code for programming language. [Read More]

Trying the new R vroom Package

Many R packages can be used to read plain rectangular data files. Among them, readr and data.table are quite popular options. Recently, the vroom package have been published on CRAN by Jim Hester. While I do not know much about the technology behind the scene, Jim says: But that’s impossible! How can it be so fast? vroom doesn’t stop to actually read all of your data, it simply indexes where each record is located so it can be read later. [Read More]
R  R package  vroom 

eemR 1.0.0

When eemR was originally created, I wrote few functions to import eems derived from the spectrofluorometers I knew. Given the high diversity in file formats, eemR now offers the possibility for the user to write his/her own import function. An example In this example, we will learn how to create a import function for a specific eem file generated by the software of a Cary Eclipse spectrofluorometer. First, lets have a look to the content of custom_cary. [Read More]

Extracting Weather Data From Canadian Archive

To me, spring 2019 seems cooler than the last year spring. I wanted to plot daily temperature data for my city. I know that the Government of Canada have such data. The following code was used to extract daily mean temperature for springs 2018 and 2019. knitr::opts_chunk$set(echo = TRUE, cache = TRUE) library(extrafont) library(tidyverse) library(glue) ## Set default ggplot2 font size and font familly loadfonts(quiet = TRUE) theme_set(theme_bw(base_size = 12, base_family = "Poppins")) The first thing I did was to create a tibble with all the dates for which I wanted to extract the weather information. [Read More]
R 

Introducing gitignore

In this post I will introduce the gitignore R package (https://github.com/PMassicotte/gitignore). Basic idea gitignore is a simple R package that provide an interface to query gitignore.io to fetch gitignore templates that can be included in the .gitignore file. More than 450 templates are currently available. There are actually two functions in the package: gi_available_templates(): to get a list of all templates available on gitignore.io. gi_fetch_templates(): to get one or more template(s). [Read More]
R 

Numerical integration in R

Math 101

Although R in not a symbolic language like Mathematica, Maple or Matlab, it can be used for calculus operations. Let’s get started. For the shake of simplicity, we will integrate the following equation: \[ f(x) = \cos(x) + 2 \] We first define the equation in the form of a function since it is a requirement to use the R integrate function. Then, plot the function curve between 0 and 4. [Read More]
R 

Calculating daylight in R

A little bit more than a year ago I moved in Denmark. So far, the last year has been quite fun and I have been working on interesting projects. The most difficult part has been the winter since the daylight is very short between November and February. I was curious to see what was the difference in daylight between my home country (Canada) and Denmark. This is a short post showing how to calculate daylight based on the latitude position and the day of the year (DOY). [Read More]
R