CI/CD and Code Coverage

Updated: 2023-05-24 A simple guide to use CI/CD and Code coverage. For CI tasks will be done using GitHub Actions. Some examples of yaml files for CI tasks can be found here eg. check-standard.yaml file. CI/CD This is a simple process to implement CI/CD using GitHub Actions with usethis package.

Read More

Pasang pakej di R

First publish date: 02.09.2019 Ini ialah beberapa penggunaan asas R yang amat berguna walaupun jarang dipakai. Antaranya: Pasang pakej Cara biasa untuk pasang pakej ialah menggunakan install.packages(). Tetapi sekiranya ingin memasang banyak pekej secara serentank dan memuatkan di R setelah pakej dipasang, cara begini boleh dipakai:

Read More

data.table tips

Updated: 2021-09-17 Some tips for data.table that I came across while googling which might be useful. Print To print more rows that default can be done with either: options(datatable.print.topn = 70) print(DT, topn = 70) Using options will implement the changes globally.

Read More

Ellipsis …

Updated: 2022-10-09 Just to remind me how I could use ellipsis or the three dots ... in my coding. There are three scenarios I find it useful: Function wrapper When creating a function wrapper and instead of providing all the arguments to be send further, you could just use .

Read More

Case when

It’s often easier to use ifelse to implement conditioning. The fast implementation in data.table of ifelse is fifelse. Other approach to do multiple conditioning is to use data.table::fcase or dplyr::case_when. fcase fcase can be used directly x <- 1:6 data.table::fcase(x < 3, 1, x >= 4, 2) To implement in a data.

Read More