How to calculate mean, median, mode, std dev from distribution How to calculate mean, variance, median, standard deviation and modus  from distribution? If I randomly generate numbers which forms the normal distribution I've specified the mean as m=24.2 standard deviation as sd=2.2:
> dist = rnorm(n=1000, m=24.2, sd=2.2)

Then I can do following:
Mean:
> mean(dist)
[1] 24.17485

Variance:
> var(dist)
[1] 4.863573

Median:
> median(dist)
[1] 24.12578

Standard deviation:
> sqrt(var(dist))
[1] 2.205351

Mode aka Modus (taken from here):
> names(sort(-table(dist)))[1]
[1] "17.5788181686221"



*

*Is this the whole magic, or is there something else that I did not
realized?

*Can I somehow visualize my bell shaped normal distribution with vertical lines representing (mean, median...)?

*What does those attributes say about distribution?


PS: code is in R
 A: Some additional and not very well known descriptive statistics.
x<-rnorm(10)

sd(x) #Standard deviation

fivenum(x) #Tukey's five number summary, usefull for boxplots

IQR(x) #Interquartile range

quantile(x) #Compute sample quantiles

range(x) # Get minimum and maximum

I am sure you can find many others in one of those freely available R manuals.
A: First a general comment on the mode:
You should not use that approach to get the mode of (at least notionally) continuously distributed data; you're unlikely to have any repeated values (unless you have truly huge samples it would be a minor miracle, and even then various numeric issues could make it behave in somewhat unexpected ways), and you'll generally just get the minimum value that way. It would be one way to find one of the global modes in discrete or categorical data, but I probably wouldn't do it that way even then. Here are several other approaches to get the mode for discrete or categorical data:
x = rpois(30,12.3)

tail(sort(table(x)),1)   #1: category and count; if multimodal this only gives one

w=table(x); w[max(w)==w] #2: category and count; this can find more than one mode

which.max(table(x))      #3: category and *position in table*; only finds one mode

If you just want the value and not the count or position, names() will get it from those
To identify modes (there can be more than one local mode) for continuous data in a basic fashion, you could bin the data (as with a histogram) or you could smooth it (using density for example) and attempt to find one or more modes that way.
Fewer histogram bins will make your estimate of a mode less subject to noise, but the location won't be pinned down to better than the bin-width (i.e. you only get an interval). More bins may allow more precision within a bin, but noise may make it jump around across many such bins; a small change in bin-origin or bin width may produce relatively large changes in mode. (There's the same bias-variance tradeoff all over statistics.)
Note that summary will give you several basic statistics. 
[You should use sd(x) rather than sqrt(var(x)); it's clearer for one thing]
--
In respect of q.2 yes; you could certainly show mean and median of the data on a display such as a histogram or a box plot. See here for some examples and code that you should be able to generalize to whatever cases you need.
A: As @Glen_b described the mode of a continuous distribution is not as straightforward as it is for a vector of integers. 
This R code will get the mode for a continuous distribution, using the incredibly useful hist() function from base R. As @Glen_b described this involves putting observations into bins - discrete categories where if the observation falls within the bin interval it is counted as an instance of that bin, which gets around the problem of it being highly unlikely in a continuous distribution to observe the exact same value twice.
set.seed(123)
dist <- rnorm(n=1000, m=24.2, sd=2.2)
h <- hist(dist, # vector
          plot = F, # stops hist() from automatically plotting histogram
          breaks = 40) # number of bins

Now we treat the midpoint of the bin interval that has the maximum count within it as the mode
h$mids[which.max(h$counts)] 

# [1] 23.75

Voila! The mode.
p.s. you could also treat the start of the interval as the mode via h$breaks[which.max(h$counts)]. As discussed modes for continuous distributions are not simple and require decisions to be made, hence why there is no simple function for them like there is with mean() and median()
