Machine learning and R language--Basic grammar

Source: Internet
Author: User

First, comments

1, check the content to be annotated, shortcut key ctrl+shift+c (uncomment the same method)

2. Enter # before you need to annotate the content

1 #需注释的内容

3, using the IF statement, set the judgment condition to false to skip the content in the IF statement, the equivalent of implementing the content of the comment

1 if (false) 2 {3       5 4       Ten  5 }    
Ii. work results preservation, data deletion and loading

1. First create two folders, named Rsourse and data, to save the project file (. r) and the file (. RDA)

2. Related functions:

(1), get current working path: GETWD ()

(2), set the working path: SETWD ()

1 setwd (". \\Rsourse")                                                       #相对路径 2 setwd (".. \")                                                             #上一级目录 3 setwd ("c:\\users\\wangcj\\onedrive\\ documents\\r-language\\")             #绝对路径

(3), folder-related

Determine if a folder exists: File.exists ("Rsourse")

Create folder: Dir.create ("Data")

(4), save

Save work: Save (x,y,file= "Basic.rda") saves X, y to the First.rda file in the current working directory

Save working Space: Save.image ()

(5), delete variable (object): RM (x, y) Delete x, y

(6), download saved value: Load ("Basic.rda")

Third, the basic function of data processing

1, calculate the standard deviation: SD () function

For example, the SD (0:100) asks for a colon between 0 and 100 of the standard deviation {0 and 100 (:) represents an integer from 0 to 100 that is entered into the SD function}

2, calculated average: mean () function

Machine learning and R language--Basic grammar

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.