> install.packages("swirl")
> require(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? lxl #根据提示输入名字
Thanks, lxl. 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: 3 #此处选择3,开始学习
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! #此处按enter
...
| 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,课程安装成功
| 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
为了看起来排版不会太乱,还是决定截图,0%是指进度,阅读完毕按enter,随着阅读量的增加,进度值越来越大,学习过程中,需要根据提示操作。若想结束学习,交互式一下代码,bye(),随时能够停止,重新打开swirl()可以重新学习或继续学习之前的知识点
日常生活中,利用零散空闲时间学习R,这个包再好不过了。比市场上卖的很多书籍错误的概率小多了,之前买过几本书练习,很多代码都是错误的,运行不出结果。