2024-10-14 / Yohann Mansiaux / development, package, tips

Beyond Functions: How to Enrich an R Package with Data

As package developers, we often focus on custom functions, their documentation, and unit testing. To provide a more complete user experience, it can be helpful to include data within the package. Here’s everything you need to know! If you’re not familiar with unit testing, we recommend reading our article on the subject: : https://rtask.thinkr.fr/expectations-verified-dive-into-the-world-of-unit-tests-with-expect_/ Short on time? Here’s the gist ...

2024-10-04 / Murielle / development, package, tips

Expectations, Verified! Dive into the World of Unit Tests with expect_*()

Unit tests are essential in the development of an R package. They ensure that your functions work as expected while protecting you from regressions when you improve or modify your code. Thanks to the {testthat} package, writing and automating tests in R becomes simple and intuitive. At the core of this approach are the expect_*() functions, which play a central ...

2022-10-04 / Sébastien Rochette / development, fusen, package, Rmarkdown, thinkrverse, tips

Package dev with {fusen} & {attachment}: load all functions of a flat, manage qmd and auto-fill Remotes field

One aim of our open-source packages at ThinkR is to make our development workflows easier. {attachment} and {fusen} are developed maintained to help packages development and maintenance. Inception… If they help us every day, they can probably help you as well! In this blog post, I present the lastest changes of these two packages. If you want to know how ...

Moissonneuse batteuse en plein récolte avec un déplacement horizontal, ligne par ligne

2021-10-21 / Vincent Guyader / data, tidyverse, tips

Row-wise operations with the {tidyverse}

We are often asked how to perform row-wise operations in a data.frame (or a tibble) the answer is, as usual, “it depends” 🙂 Let’s look at some cases that should fit your needs. library(tidyverse) Let’s make an example dataset: base <- tibble::tibble( a = 1:10, b = 1:10, c = 21:30 ) %>% head() base ## # A tibble: 6 ...

gtlabr hex logo inside a rectangle

2021-08-31 / Sébastien Rochette / development, git, package, thinkrverse, tips

{gitlabr} v2.0 is on CRAN!

You regularly create projects on GitLab with a common skeleton, you want to retrieve the list of GitLab issues to create a report, you are looking for batch modifications of your projects? Use the GitLab API from your preferred programming language R. Communicate with GitLab API from R Here is a small example as issued from the {gitlabr} Readme on ...

Processus development collaborative

2021-04-19 / Sébastien Rochette / development, Rmarkdown, rstudio, thinkrverse, tips

A guide to collaborative development with R for reproducible PROPRE reporting

With our “PROPRE” Project Guide, get a publishing committee and a development team to collaborate on creating your automated reports using the “PROPRE” methodology. Follow our suggestions for organization, tools and R development practices, for a controlled and benevolent DevOps practice. It is possible to collaborate around git in a team composed of developers and non developers. In this guide ...

A HTML report created from git messages using gitdown package

2020-08-10 / Sébastien Rochette / tips, development, package, thinkrverse

Download Gitlab or Github issues and make a summary report of your commits

While working on our {gitdown} package, I wanted to show more information on the report generated by retrieving all issues of my Gitlab / Github repositories. Indeed, titles of issues could improve readability and information of the git report of this package. How can I download all issues information from git repositories? Context of {gitdown} development {gitdown} is a package ...

blogrmdfirst_header

2019-07-09 / Sébastien Rochette / development, package, Rmarkdown, tips

Rmd first: When development starts with documentation

Documentation matters ! Think about future you and others. Whatever is the aim of your script and analyses, you should think about documentation. The way I see it, R package structure is made for that. Let me try to convince you. At use’R 2019 in Toulouse, I did a presentation entitled: ‘The “Rmd first” method: when projects start with documentation’ ...

2019-05-07 / Sébastien Rochette / development, package, thinkrverse, tips

{attachment} is on CRAN !

We are pleased to announce that our package {attachment} is now available on CRAN. The goal of attachment is to help to deal with package dependencies during package development. It also gives useful tools to install or list missing packages used inside Rscripts or Rmds. Deal with dependencies during package development If you ever had the following error when checking ...

2019-04-28 / Sébastien Rochette / database, docker, maps, tips

Interact with PostGIS from R

PostGIS extends capabilities of PostgreSQL database to deal with spatial data. Using PostGIS, your database supports geographic queries to be run directly in SQL. In this blog post, we will connect and interact with a PostGIS database from R, using {DBI} and {sf}. Package {sf} and PostGIS are friends Package {sf} is similar to PostGIS database in multiple ways: R ...

2019-03-08 / Sébastien Rochette / dataviz, maps, tips

SatRday Paris: Build interactive waffle plots

Can mapping tools be diverted to other uses? Of course ! See how we play with leaflet and leafgl to quickly render a giant waffle made of millions of polygons. Spatial tools are not only for spatial data At SatRday in Paris, I presented a talk entitled “Everything but maps with spatial tools”. The aim is to show that there ...