当前位置:网站首页>Machine learning notes - Introduction to R language learning series I

Machine learning notes - Introduction to R language learning series I

2022-06-09 09:55:00 Sit and watch the clouds rise

One 、R Overview and installation

        R It is a free software environment for statistical calculation and graphics . It can be in all kinds of UNIX platform 、Windows and MacOS Compile and run on .

        Official download address :

CRAN - Mirrorshttps://cran.r-project.org/mirrors.html        windows Just download and install the version .

        The interface after installation is as follows

         Use R, You can write functions 、 Calculate 、 Apply most available statistical techniques 、 Create simple or complex graphics , Even write your own library functions .

         R The programming used in is similar in different ways . therefore , Once you learn to apply linear regression , Modify the code to perform generalized linear modeling or generalized additive modeling , Just change a few options or make small changes to the formula . Besides ,Rhas Excellent statistical facilities . Almost everything you might need in statistics has been programmed and is now R Available in the ( As part of the main package or as a user contribution package ).

Two 、 Preliminary use

1、2+2

        We input... At the console 2+2, And then go back , You'll get 4, Is not surprising .

 2、log(2)

        We input... At the console log(2), And then go back , obtain 0.6931472.

 3、log10(2)

         We input... At the console log10(2), And then go back , obtain 0.30103.

  3、 ... and 、 Drawing function

        R Excellent drawing tools . But the same , You need to enter code or copy it from a previous project to implement .

setwd("D:\\57R")
ISIT<-read.table("D:\\57R\\RBook\\ISIT.txt",header=TRUE)
library(lattice)
xyplot(Sources~SampleDepth|factor(Station),data=ISIT,
xlab="Sample Depth",ylab="Sources",
strip=function(bg='white', ...)
strip.default(bg='white', ...),
panel = function(x, y) {
panel.grid(h=-1, v= 2)
I1<-order(x)
llines(x[I1], y[I1],col=1)})

        among  ISIT.txt The contents are as follows , Baidu online disk download address

 link :https://pan.baidu.com/s/18QwZb91hcmRR3UOGL48R9Q 
 Extraction code :dpso

         The icon is shown below

原网站

版权声明
本文为[Sit and watch the clouds rise]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090924421395.html