R

2015年10月1日星期四

using swirl()[0]

> library(swirl)

| Hi! I see that you have some variables saved in your
| workspace. To keep things running smoothly, I
| recommend you clean up before starting swirl.

| Type ls() to see a list of the variables in your
| workspace. Then, type rm(list=ls()) to clear your
| workspace.

| Type swirl() when you are ready to begin.

>
> swirl()

| Welcome to swirl!

| Please sign in. If you've been here before, use the
| same name as you did then. If you are new, call
| yourself something unique.

What shall I call you?

2015年9月28日星期一

The first tasting

The first tasting

> 1:5   #列出1到5的整数
[1] 1 2 3 4 5
> c(1,2,3,4,5)  #使用c()
[1] 1 2 3 4 5
> sum(1:5)  #加总
[1] 15
> mean(1:5)  #平均数
[1] 3
> median(1:5)  #中位数
[1] 3