#Pirmer asignación
3+2
## [1] 5
3-2
## [1] 1
4-4
## [1] 0
3*2
## [1] 6
4*5
## [1] 20
10/2
## [1] 5
3^2
## [1] 9
3^2
## [1] 9
2^-3
## [1] 0.125
3^2
## [1] 9
2^2
## [1] 4
100^(1/2)
## [1] 10
2^(-3)
## [1] 0.125
sqrt
## function (x)  .Primitive("sqrt")
sqrt(100)
## [1] 10
exp(1)
## [1] 2.718282
log(exp(1))
## [1] 1
log10(1000)
## [1] 3
log2(8)
## [1] 3
log(16,base=4)
## [1] 2
sin(pi/2)
## [1] 1
cos(0)
## [1] 1
bienvenidos <- ("al tutorial de R")
x<-1.7
class(x)
## [1] "numeric"
is.numeric(x)
## [1] TRUE
is.numeric(x)
## [1] TRUE
is.numeric(bienvenidos)
## [1] FALSE
y=as.numeric(x)
x=1.34
class(x)
## [1] "numeric"
y=as.integer
y=as.integer(x)
is.integer(y)
## [1] TRUE
class(y)
## [1] "integer"
c=3.5+4i
is.complex(x)
## [1] FALSE
is.complex(c)
## [1] TRUE
class(c)
## [1] "complex"
logical=t
logical=T
logical
## [1] TRUE
l=FALSE
class(l)
## [1] "logical"
str <- "programando estoy"
class(str)
## [1] "character"
is.character(str)
## [1] TRUE
numeros <- c(1,2,3,4,5)
numeros
## [1] 1 2 3 4 5
class(numeros)
## [1] "numeric"
length(numeros)
## [1] 5
numeros[3]
## [1] 3
numeros[5]
## [1] 5