fix R tutorial code
more update

- Array2D slice
- calculate means