[Reading notes] R language Combat (i) Introduction to the R language

Source: Internet
Author: User

Typical data analysis steps:

R Language: Language and environment for statistical calculations and plotting

Data analysis: Statistics, machine learning

Use of R

1. Case-sensitive, interpreted language

2. R Statement Assignment: <-

3. R Comment: #

4. Create vector C ()

5. Watch Demo List demo (), Graphic demo demo (graphics)

6. Help function

7. GETWD () View current working directory, SETWD () set Current working directory

SETWD (' e:\\ ') GETWD () [1] "e:/"

8. Working space management functions

9. Input and output

1). Enter

Source (' filename ') executes a script in the current session

2). Text output

Sink (' filename ') output redirected to file filename, append=true append file

3). Graphics output

4). Dev.off () output back to Terminal

#在当前会话中执行脚本source ("script1. R ") #文本输出 [append] to Myoutput, the graphic output is saved to Mygraphs.pdfsink (" Myoutput ", Append=true, split= TRUE) in PDF (" Mygraphs.pdf ") Source (" Script2. R ") #sink () #结果返回到终端dev. Off () source (" Script3. R ")

10. Package Management

#安装ggplot2包install. Packages ("Ggplot2") #更新ggplot2包update. Packages ("Ggplot2") #载入包library (Ggplot2) #查看已加载包 (. Packages ()) #卸除包detach ("Package:ggplot2") #卸载包remove. Packages ("Ggplot2")

  

  

[Reading notes] R language Combat (i) Introduction to the R language

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.