02_R Programming for Data Science

  • Post author:
  • Post category:其他


1. Load code to R
(1) copy code to console
(2) put file into working directory, then source(“____.R”)
2. Operators
(1) <-   : assignment operator
(2) #    : hash symbol(comment)
(3) :    : colon operator(integer sequence)
(4)+-*/^ : arithmetic operator
(5)> < ==: logical operator
>= <=
& | !
&& ||
3. R Objects
(1) classes: character, numeric, integer, complex, logical
(2) vector: class of elements must be same
(3) list: class of elements can be different
4. Sequence number
(1): create a sequence of numbers
(2)seq(from,to,by/length=,along.with=take the length from the length of this argument)
(3)seq_along()
(4)rep(,times/each=)
5. Vector
(1) c/vector()
List
(1) list()
6. Matrix </



版权声明:本文为lihaosnoopy原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。