“r MAX e MIN FUNÇÕES” Respostas de código

r MAX e MIN FUNÇÕES

max(x)
min(x)
Itchy Ibex

r MAX e MIN FUNÇÕES

min(c(mtcars$mpg, mtcars$cyl))                 # Min between two columns / vectors
# 4
Itchy Ibex

r MAX e MIN FUNÇÕES

max(mtcars$mpg)                               # Compute max of column mpg
# 33.9
Itchy Ibex

r MAX e MIN FUNÇÕES

sapply(mtcars, min)                           # Compute min of all columns
#    mpg    cyl   disp     hp   drat     wt   qsec     vs     am   gear   carb
# 10.400  4.000 71.100 52.000  2.760  1.513 14.500  0.000  0.000  3.000  1.000
Itchy Ibex

r MAX e MIN FUNÇÕES

min(mtcars[5,])                               # Compute min of one row
# 0
Itchy Ibex

r MAX e MIN FUNÇÕES

max(c(mtcars$mpg, mtcars$cyl))                 # Max between two columns / vectors
# 33.9
Itchy Ibex

r MAX e MIN FUNÇÕES

max(x2, na.rm = TRUE)                         # Specify na.rm = TRUE
# 20
Itchy Ibex

r MAX e MIN FUNÇÕES

max(mtcars[5,])                               # Compute max of one row
# 360
Itchy Ibex

r MAX e MIN FUNÇÕES

sapply(mtcars, max)                           # Compute max of all columns
#    mpg     cyl    disp      hp    drat      wt    qsec      vs      am    gear    carb
# 33.900   8.000 472.000 335.000   4.930   5.424  22.900   1.000   1.000   5.000   8.000
Itchy Ibex

r MAX e MIN FUNÇÕES

max(mtcars)                                   # Apply max algorithm to whole data.frame
# 472
Itchy Ibex

Respostas semelhantes a “r MAX e MIN FUNÇÕES”

Perguntas semelhantes a “r MAX e MIN FUNÇÕES”

Mais respostas relacionadas para “r MAX e MIN FUNÇÕES” em R

Procure respostas de código populares por idioma

Procurar outros idiomas de código