+++ title = ‘2019 05 27 Building My First R Package’ date = 2019-05-27T09:46:23Z draft = true meta_img = “” tags = [“R”,“Data Science”] description = “Building a data package for R. A first experience.” hacker_news_id = “” lobsters_id = “” +++

The begining

In the beginning I read a post from David Robinson advising aspiring Data scientist to start a blog and to create a package starting by data package that can be useful.

So I decided to follow his advice and tried to find a good purpose for my package first.

On my way I encountered the dslabs and gapminder packages used by many R users and Jennifer Bryan to teach students. I therefore found the gapminder site being an amazing source of data.

Now the next thing to find was the purpose of my package, the why. Beyond the advice from David Robinson I had in mind to build a package that can be really useful for peoples especially African peoples. In Africa, it’s obvious that it’s almost impossible to find data on our countries or keys social, economic or environmental fields for instance. So my idea was that if I can grab enough data on African countries and put together all theses datasets into an R package, it can be very useful for African. And this was my why: put in hand of African first data on Africa.

The development

My why found and the source found, th enext question for me was to know how can I built this package? An once again the amazing R community brung me an answer through the R packages book of Hadley Wickham.

This book gave me all I need to build my package from dataset to the final package without any other need for other book.

I found it more than useful but precious.

With the help of R package book the development process was quite straightforward. And in no more than one month I was already done. The one month duration was actually due to the fact that I was working from at a company and that I needed to download all the spreadsheet wanted first from Gapminder.

During the development, the part where I learnt a lot was in automatizing the import, tidy and transformation steps of data from .xlsx file to .rda files.

The end

Now my package named after my purpose afrods, is available from my github and can be installed right in R using:

devtools::install_github('ebedthan/afrods')

Hope this will help many peoples, R users, Data analyst or scientist in Africa an around the world for teaching and for drawing insigths.