Highlights of the new RStudio releases

The new release of R Studio got many improvement. As I read them, I was very so excited about the new functions. Here are highlights for me. Data can be filtered, searched, and sorted Execute R code from the Source…

Configure Git for RStudio

There is an article from RStudio explained how to configure Git for RStudio. But it is not very detailed. I ran into many problem during the configuration and wasted a lot of time just for configuration.  So I decided to…

Animating a point walking flow with python

Using the SimpleGUICS2Pygame can animate the walking path easily. (The SimpleGUICS2Pygame is a implementation of simplegui.) I wrote an small code for the simulation in codeskulptor, you can run it directly and see the effect: But you need to install and…

solution for installing pygame

I have two computers, the one has windows system at home, the other has ubuntu system in my office. In each computer, I have two python, the one is normal python, the other is anaconda. I try to install the…

trunc() and floor(), round() and signif() in R

floor takes a single numeric argument x and returns a numeric vector containing the largest integers not greater than the corresponding elements of x. trunc takes a single numeric argument x and returns a numeric vector containing the integers formed…

Plot Histogram in R

Plot Histogram in R: Method 1: hist(vector, breaks) Take care for the parameter “breaks”: according the help: breaks: a single number giving the number of cells for the histogram. Important: the number is a suggestion only! The breakpoints will be…

matrix calculation in R and Python

Useful packages: R: library(matrixcalc) Python: numpy Matrix generation: R: matrix(1:6, 2, 3) Python: np.arange(1,7).reshape(2,3) construct a diagnal matrix: R: advanced-R diag(vector, nrow, ncol) #construct a matrix which diagonal elements is equal to the vector diag(matrix) # a vector which elements is…