#define a function
mysummary <- function(x) {
center <- mean(x); spread <- sd(x)
result <- list(center=center,spread=spread)
return(result)
}
# invoking the function
set.seed(1234567)
x <- rnorm(400, 1, 3)
summary(x)
y <- mysummary(x)
y$center
y$spread