R语言入门之swirl(入门必玩的包)

非常好用的一个包#

这是一个R包实现的交互教程。

用来学习R语言,及其统计相关课程的。

step 1.安装包#

1
install.packages("swirl")

step 2. 你好!#

加载包,并运行swirl()函数,然后我们就学习->练习->学习->练习,并且是互动的,好比调戏siri一般,还把R给学了。

1
2
3
4
5
6
7
> require(swirl) # 等价 library('swirl')
> 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? wukong

首先它会问你怎么称呼,我告诉它我叫 wukong。然后它会问我想干嘛:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| Thanks, wukong. Let's cover a couple of quick housekeeping items before we begin
| our first lesson. First of all, you should know that when you see '...', that
| means you should press Enter when you are done reading and ready to continue.

... <-- That's your cue to press Enter to continue

| Also, when you see 'ANSWER:', the R prompt (>), or when you are asked to
| select from a list, that means it's your turn to enter a response, then press
| Enter to continue.

Select 1, 2, or 3 and press Enter

1: Continue.
2: Proceed.
3: Let's get going!

我选3, 开始吧。

step 3. 选课#

首先我们要选课,好几个课可以选。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| To begin, you must install a course. I can install a course for you from the
| internet, or I can send you to a web page
| (https://github.com/swirldev/swirl_courses) which will provide course options
| and directions for installing courses yourself. (If you are not connected to
| the internet, type 0 to exit.)

1: R Programming: The basics of programming in R
2: Regression Models: The basics of regression modeling in R
3: Statistical Inference: The basics of statistical inference in R
4: Exploratory Data Analysis: The basics of exploring data in R
5: Don't install anything for me. I'll do it myself.

Selection: 1
|==========================================| 100%
| Course installed successfully!

在这里给大家解释一下课程

1: R Programming: The basics of programming in R -> R编程基础
2: Regression Models: The basics of regression modeling in R -> 回归模型
3: Statistical Inference: The basics of statistical inference in R -> 统计推断
4: Exploratory Data Analysis: The basics of exploring data in R -> 数据分析
5: Don’t install anything for me. I’ll do it myself.

既然是新手的话,那我们就选择1,R编程,于是它就会 开始下载 相关课程

step 4. 上课#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Selection: 1
|============================================| 100%

| Course installed successfully!


| Please choose a course, or type 0 to exit swirl.

1: R Programming
2: Take me to the swirl course repository!

Selection: 1

| Please choose a lesson, or type 0 to return to
| course menu.

1: Basic Building Blocks
2: Workspace and Files
3: Sequences of Numbers
4: Vectors
5: Missing Values
6: Subsetting Vectors
7: Matrices and Data Frames
8: Logic
9: Functions
10: lapply and sapply
11: vapply and tapply
12: Looking at Data
13: Simulation
14: Dates and Times
15: Base Graphics

step 5.帮助提示#

给你们一个常用函数提示

1
2
3
4
5
6
7
8
9
10
11
12
13
14
| You can exit swirl and return to the R prompt (>) at any time by pressing the Esc
| key. If you are already at the prompt, type bye() to exit and save your progress.
| When you exit properly, you'll see a short message letting you know you've done so.

| When you are at the R prompt (>):
| -- Typing skip() allows you to skip the current question.
| -- Typing play() lets you experiment with R on your own; swirl will ignore what you
| do...
| -- UNTIL you type nxt() which will regain swirl's attention.
| -- Typing bye() causes swirl to exit. Your progress will be saved.
| -- Typing main() returns you to swirl's main menu.
| -- Typing info() displays these options again.

| Let's get started!

R的话,不太像python,希望我们能一起学好吧!

北月 wechat
欢迎您扫一扫上面的微信公众号( 或者搜索:WK_wwxk )订阅吾空的微信公众号
┭┮﹏┭┮学业繁忙,暂未运营,没时间,先挂着瞅瞅,嘿嘿
可以对我进行打赏了哦!!!
如果觉得本文对您有启发,可以随意打赏一点鼓励我继续更新!
显示 Gitment 评论
0%