Tony Tsai

May the force of science be with you

May 7, 2018 - 3 minute read - Comments - R

Setting PATH Variable for gs Command in RStudio

Update on 2018-07-05 From the discussion with Yihui Xie, if Ghostscript was installed via brew, Homebrew should automatically make symlinks to /usr/local/bin/gs which is already under the PATH. Hence there is no need to set PATH variable for gs. However, the following approach is useful for other commands that are not under the PATH. These days I am using ImageMagick to convert multiple pdfs (or pngs) into an animation gif to demonstrate the algorithm that I proposed for estimating epidemic onset.

Dec 21, 2017 - 2 minute read - Comments - Research

Tips for Sharing Data When Collaborating with Other Researchers

Recently I have been collaborating with others on several research projects. In the process of collaboration, data exchanging is inevitable; however, for collaborators lack of rich experience in data analysis and computer skills, the way that they are sharing the data results in inefficient collaboration. Therefore, I summarize following tips for sharing data when collorating with other researchers. First of all, please include a README file describing the data, including file contents, variable names, value formats, units etc.

Dec 4, 2017 - 3 minute read - Comments - R

Detecting Non-breaking Space in R

Last night while I was cleaning data in R, I encountered such a weird behavior of unique() function that I once suspected that there had been something wrong with the newly updated R 3.4.3. The following is a reproducible example of my problem. I read in a vector variable x from csv file, and printed it on R console. x ## [1] "non-breaking space" "non-breaking space" Apparently, x contained two “identtical” elements and it should have only one unique value.

Sep 7, 2017 - 2 minute read - Comments - Python

pip for Different Versions of Python on macOS Sierra

Three versions of Python exist on my macOS Sierra. The first one is the original Python come with macOS. The other two are Python 2 and Python 3 installed by brew. To load the raw Python 2 interpreter inside the terminal, type $ python Python 2.7.10 (default, Feb 7 2017, 00:08:15) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> To load the brew-installed Python 2 interpreter inside the terminal, type

May 23, 2017 - 3 minute read - Comments - R

Narrative Outline of My Talk at the 10th China R Conference

The 10th China R Conference was held in Tsinghua University during May 19 - 21. I initialized the session of R in Public Health. Though it was my first time to organize a session, to invite speakers, and to host it, the session was successful. The number of audiences was more than 55 persons and beyond my expectation, and the discussions were enthusiastic. I believe that via my talk more Chinese have known the R Epidemics Consortium (RECON) and they may try to use RECON packages to facilitate their epidemics research.