Suggest R and Rstudio!
The R language is composed of functions and assignments.
R uses <-(preferably a habit) rather than the traditional = as an assignment symbol. For example: X<-rnorm (5) (or Rnorm (5)->x) creates a vector object named X that contains 5 random deviations from a standard normal distribution.
R allows the use of = assignment, but it is not a standard syntax, and sometimes problems occur, not recommended.
There is also a third method of assignment: Assign ("J", 4). More trouble, but sometimes it is necessary!
Comments begin with # and any subsequent text will be ignored by the R interpreter.
Second, the Help statement in R:
Help.start (): Opens the Help document first page.
Help ("foo") or? Foo: Opens the helper document for function Foo. (quotation marks can be omitted)
Example ("foo"): use instance of function Foo. (quotation marks can be omitted)
Third, the function of managing R space:
GETWD (): Displays the current working directory.
SETWD ("C:/mydata"): Modifies the current working directory to MyData. Attention is "/"! (and temporarily change the working directory, when R is reopened, the working directory is restored to the default.) Once and for all the solution is to right-click R or Rstudio shortcut, change the starting position, such as my: Right-click rstudio--> start Position "E:\My-R-Data")
LS (): Lists the objects in the current workspace.
RM (ObjectList): Removes (deletes) one or more objects.
RM (List=ls ()) is the equivalent of clear in MATLAB, which indicates that all variables in the working environment are clear.
Source ("filename"): Executes a script. (quotation marks cannot be omitted!) You'll have to bring the file extension too! )
Four, R package
A package is a collection of r functions, data, and precompiled code in a well-defined format. The directory where the package is stored on the computer becomes a library.
Download pack: Install.packages ("_"), note that quotation marks cannot be omitted! You can also install multiple packages install.packages (C ("_", "_") at once.
Loading: library (_), without quotation marks. Every use once to load, trouble ~ ~
About the R language, I am now mainly looking at "R language Combat", this is a very good entry-level textbook! Now the second version has come out, more than the first version of the 200+ page.
Introduction to R language