We have a repeated-measuring data. We want to take average every 3 periods. Here is code to do it.
Hotkeys in sublime text
一些sublime text 3好用的快捷鍵。
利用windows batch快速複製excel檔案(逐月),並在excel依檔名變更日期
Parsing html page with javascript
Here is a demonstration to grab lottery number by using RSelenium. Since RCurl cannot parse the table produced by javascript, we need to construct a server to interpret javascript and grab the information we need. The tool of building server is RSelenium. It is simple to generate the html page by javascript, then we can access the table we want.
Faster R in windows
R的BLAS庫效率不彰,在linux上可以透過更換成openBLAS來加速,或是compiled with intel MKL,在windows上compile R是一個痛苦的過程。
因此,有人提供這方面的資源,最有名的就是Revolution,Revolution是compiled with intel MKL,但是要錢。但是天無絕人之路,總是有其他辦法的。
Implementation for summing a list of matrices
Usually, we have to sum a list of matrices, I introduce several ways to do that.
Finding unique rows of a matrix in mex
This code is to find the unique rows of a matrix. It is based on the quick sort algorithm. Thanks to this, I can use MatLab to implement faster sorting of rows.
I compiled this code with Microsoft Visual Studio 2015 and Intel Parallel Studio XE 2017 and linking to armadillo library.
Tables combining
A benchmark for combine the two data.frames in R.
Grouping in a fixed time interval
There is a data give the Time and ID to find the Session. The value of variable session is given by the Time
variable. The session of first time in ID is 1, session is 2 if the different time between its time and the first time of session time is longer than 1 hour, and otherwise session is 1 until next time is out of range of 1 hour.
R with GPU performance of gputools
I can’t wait to test the performance of R with GPU. I test the performance of gputools and OpenCL.