In general, this book covers a lot of r language knowledge, but the content of the relatively trivial, it is difficult to string the whole book chapters, if it as a knowledge dictionary of the R language is very good. This book mainly covers the following, but it does not carry out in-depth discussion of these contents.the next thing to doThe output of the R detection function needs to be thoroughly understoodCombining real-life case practice with the contents of this bookR Language Programming
This function is a function under the Stringr package, it is useful to do data cleaning, presumably use to extract a string under a certain content, according to some of the rules you want, the specific use of the following:
x
Str_extract_all (x, "[F0-9]")[[1]][1] "F" "1" "2"
> Str_extract_all (x, "[f0-9]{1,3}")[[1]][1] "F12"
> Str_extract_all (x, "[f0-9]{1,2}")[[1]][1] "F1" "2"
Attach some code written in peacetime
Library (GGPLOT2) library (rmysql)
In the recent internship need R language analysis, for the final result needs to be shown below the diagram to show (sample image in the paper interception)
Because of contact with R language soon, just start is a variety of Meng, think directly with R is not drawing such pictures, and then asked the classmate said with R language Ggplot2 expansion package, so found some tutorials on the internet to find this kind of picture can be painted, but its
packages covered in this article are:
In [3]:
Set.seed (1680) # Set a random seed, making the results of this article a reproducible library (DPLYR) library (ISLR) library (
cluster) library
(Rtsne )
Library (GGPLOT2)
Attaching package: ' Dplyr '
The following objects is masked from ' package:stats ':
filter, lag the
following O Bjects is masked from ' package:base ':
intersect, Setdiff, setequal, union
Before building a clustering mod
(y~x1*x2), y = a*x1+b*x2+c*x1*x2+d
Lm (Y~X1*X2*X3)
Y =a*x1+b*x2+c*x3+d*x1*x2+e*x1*x2+f*x2*x3+g*x1*x2*x3+h
Lm (Y~X1+X2+X3+X1:X2:X3)
y = a*x1+b*x2+c*x3+d*x1*x2*x3+e
SETP stepwise regression, you can remove the meaningless variable backwards, you can add a new variable to the forward regression
Lm (y~x1, subset=1:100) selects only the first 100 data for regression
Lm (Y~i (X1+X2)) to (X1+X2) regression
Lm (Y~ploy (x,3,raw=true)) Y is the three-quadratic polynomial regression of x
Lm (log (y) ~ x1
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.