马上就要期末考试了,学了一学期的R语言,但感觉相关的知识点非常的繁琐,复习起来光看代码和课堂笔记也很困,所以一直在想有没有相关的平台可以进行操练。
最后找到了一个R语言的包,叫swirl,它是JHU开发出来的一个交互式R语言自学包,听上去很高级,自己练习了一天以后感觉非常不错,很基础,适合初学者上手,而且学习起来一点也不困,因为一直在思考+敲键盘。不过也需要你英语水平过关,因为是全英文的互动界面:
那么怎么开始呢,你只需要先清空工作台:
rm(list = ls())
然后在RStudio里面进行包的安装,根据指令就可以进行开始自学啦:
> install.packages("swirl")
> library(swirl)
| Hi! 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? Lucas
'''
| Thanks, Lucas. 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!
Selection: 1
'''
| 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!
'''
开场白结束以后,它会提供5个大的课程,每个课程里面对应多个章节,每个章节为一个小课,因此不要以为学完该章节就把整个学完了, That’s not even close!
| 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!
| 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
Selection: 7
| | 0%
| In this lesson, we'll cover matrices and data frames. Both represent
| 'rectangular' data types, meaning that they are used to store tabular data, with
| rows and columns.
开始快乐学习吧!
版权声明:本文为yichao0630原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。