maggiore.n | R Documentation |
Trova il maggiore tra un insieme di numeri. Funzione di esempio per il ciclo for
.
maggiore.n( x )
x |
vettore di numeri. |
Restituisce il valore maggiore tra quelli del vettore x
.
Massimiliano Pastore
x <- rnorm(10)
maggiore.n(x)
## The function is currently defined as
function(x)
{
mx <- x[1]
for (i in 2:length(x)) {
if (x[i]>mx) mx <- x[i]
}
return(mx)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.