R fundamental 1
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了R fundamental 1相关的知识,希望对你有一定的参考价值。
1.1 R Environment
It is doable to run on the systems like Windows、 Linux and Unix. The most convience way to manipulate R is through graphies interface.
1.2 Interactively
All command work through a prompt and default prompt is ‘>‘, which could be the same either on Linux or Windows shell prompt.
1.3 Getting help
R has a build-in help facility. The command is
>help(object)
An alternative is
>?object
If a command is not finished at the end of a line, R will give a default symbol ‘+‘, and it will read the input from second line or subsequent lines until command is done.
2. 1 Numbers and Vectors
R operates on named data structures. The very simplest one is numeric vector.The keyword is ‘c‘ and assignment operator ‘<-‘. For example, to set up a vector named x, concludes total 3 numbers, namely 1, 2, 3, the command is
> x <- c(1, 2, 3)
or in the oppsite direction
> c(1, 2, 3) -> x
Assignment can also be done using by function ‘assign()‘.
> assign("x", c(1, 2, 3))
2.2 Arithmetic
Just use arithmetic expressions can fulfill the calculation needs. The elementary arithmetic operators are the usual ‘+, -, *, /, ^‘. Additional operators includes ‘min, max, length, sum, log, exp, sin, cos, tan, sqrt...‘. Symbol "i" for the complex numbers.
以上是关于R fundamental 1的主要内容,如果未能解决你的问题,请参考以下文章
Self-Paced Training - Docker Fundamentals
Fundamentals 4 Odin removeFromArray 语法问题?
python:numpy-1:fundamental knowledge