install.packages("rgl")
update.packages("rgl")
remove.packages("rgl")
library(rgl)
| تعریف | عملگر |
|---|---|
| عملگر جمع | x+y |
| عملگر تفریق | x-y |
| عملگر ضرب | x*y |
| عملگر توان | x^y یا x**y |
| عملگر تقسیم | x/y |
| باقیماندۀ تقسیم | x%%y |
| خارجقسمت صحیح تقسیم | x/%/y |
2*(4-1)^(1+1)
## [1] 18
2*4-1^(1+1)
## [1] 7
2*(4-1)^1+1
## [1] 7
2*4-1^1+1
## [1] 8
نامگذاری:
“حروف انگلیسی” + “اعداد” + نمادهای”.” و “_”
انتسابها:
<- <= -> => = assign()مثال.
x=2
x
## [1] 2
y<-3
y
## [1] 3
z<<-5
z
## [1] 5
7->a
a
## [1] 7
-9->>b
b
## [1] -9
assign('t',sqrt(2))
t
## [1] 1.414214
x
## [1] 2
rm(x)
x
Error: object 'x' not found
ls()
## [1] "a" "b" "t" "y" "z"
rm(list=ls())
ls()
## character(0)
class() mode()
مثال.
x<-5.3
x
## [1] 5.3
class(x)
## [1] "numeric"
mode(x)
## [1] "numeric"
is.numeric(x)
## [1] TRUE
is.logical(x)
## [1] FALSE
is.character(x)
## [1] FALSE
is.integer(x)
## [1] FALSE
class(4L)
## [1] "integer"
mode(4L)
## [1] "numeric"
is.integer(4L)
## [1] TRUE
class("x")
## [1] "character"
mode("x")
## [1] "character"
is.numeric("x")
## [1] FALSE
is.character("x")
## [1] TRUE
z<- 1+2i
z
## [1] 1+2i
is.complex(z)
## [1] TRUE
t<-TRUE
t
## [1] TRUE
class(t)
## [1] "logical"
mode(t)
## [1] "logical"
is.logical(t)
## [1] TRUE