There are various ways to organise your R workflow. If you are working with a big project, then Airflow might be for you. But for the majority of R project codes, drake package will fullfilled your need. Here is the basic use of drake.
Read MoreGit Clone
This is just 100% a copy from gist so I can check it when needed. So you’ve cloned somebody’s repo from github, but now you want to fork it and contribute back. Never fear! Technically, when you fork “origin” should be your fork and “upstream” should be the project you forked; however, if you’re willing to break this convention then it’s easy.
Read MorePemakaian lookup table
Lookup table dipakai untuk mempercepatkan proses dan mengelakkan pemakaian ifelse. Untuk mempercepatkan proses, ordered index untuk data.table harus dipakai. Cara 1 Cara ini ialah untuk mendapakan nilai ScoreLU yang terdapat di dataset dt2 melalui kolom kekunci DSCRpd dikedua-dua data.table. Sekiranya nilai di DSCRpd di dt1 tidak sama dengan dt2, nilai yang berhampiran di DSCRpd dirujuk untuk mendapatkan nilai ScoreLU.
Read MorePadamkan barisan (row)
Untuk memadamkan barisan di data.table menggunakan reference seperti penggunaan .SD masih belum dilaksanakan. Cara ini diambil dari perbincangan di GitHub data.table. Fungsi delete dibuat seperti begini: delete <- function(DT, del.idxs) { # pls note 'del.idxs' vs. 'keep.idxs' keep.idxs <- setdiff(DT[, .
Read MoreStatic encrypting HTML
Cara ini diambil dari GitHub robinmoisson. Boleh baca disitu untuk cara selanjutnya. Antaranya: Pemasangan NVM (Node Version Manager) diperlukan untuk memudahkan pemasangan Node.js dan program staticrypt. Curl diperlukan untuk dapatkan Node.js. Untuk memasang hanya NVM, boleh dibuat seperti dibawah atau dibaca di sini:
Read More