R learning experience notes (codeschool-based Tryr course)
1. vectors. The essence of a vector is a JSON file, but sometimes it can be viewed as an encapsulation. As a JSON file, you can think of it as two rows. The default value is
Vector
{1 :"...",
2 :"...",
3 :"...",
.......}
The general operation is to assign values to the right by default, but you can change the value to the left when necessary.
Vector
{"England ":"...",
"China ":"...",
"Australia ":"...",
.......}
The function used is name.
Barplot and plot are used to visualize (Be careful with the difference between plot (x, y) and plot (y) abline for loading and calculating functions with statistical data.
There are two methods for creating a basic vector: C () and SEQ (), and a: B is a very special one.
As a whole encapsulation, operations on it can be seen as operations on all of its data.
In addition, you must note that functions in R can process unit interactions with data of different lengths. One is another multiple !!
2, martrix:
One of the three methods is to create a matrix (value, x, y). The other two are to develop from the vector and use JSON (data). You can directly use matrix (vector, x, y) you can also use integrity to convert a matrix to a dim (vector) <-C (x, y ).
When Matrix [x,] matrix [, y] is equivalent to vector matrix [A: B,], it is a small matrix.
R study notes