24
What is R? R is a programming language, and also a environment for statistics analysis and graphics Why use R R is open and free. Currently contains 5088 packages that makes R a powerful tool for financial analysis, bioinformatics, social network analysis and natural language process and so on. More and more people in science tend to learn and use R # BioConduct: bioinformatics analysis(microarray) # survival: Survival analysis

28
28 Vector and vector operation Vector is the simplest data structure in R, which is a single entity containing a collection of numbers, characters, complexes or logical. # Create two vectors: # Check the attributes: # basic operation on vector: 注意这个向 左的箭头

33
33 list List is an object that containing other objects as its component which can be a numeric vector, a logical value, a character or another list, and so on. And the components of a list do not need to be one type, they can be mixed type. >Lst length(Lst) # 4 >attributes(Lst) >names(Lst) >Lst[[1]] >Lst[[“drugName”]] >Lst$drugName

34
34 Data Frame A data frame is a list with some restricts: ① the components must be vectors, factors, numeric matrices, lists or other data frame ② Numeric vectors, logicals and factors are included as is, and by default character vectors are coerced to be factors, whose levels are the unique values appearing in the vector ③ Vector structures appearing as variables of the data frame must all have the same length, and matrix structures must all have the same row size Names of components