| smedian | R Documentation |
Calculate the median of the values from a specified vector. Only a contiguous subsection of the vector is used for the calculation, as the first and last position are set by user.
smedian(pos, v)
pos |
a |
v |
a |
a double which is the median of the values.
Alexander Krasnitz, Guoli Sun
## A vector with the first and last positions to subset the value vector
position <- c(1, 10)
## A value vector used to do the calculation
values <- c(0.072073840, 0.119913919, 0.154459489, 0.040994620, -0.082843732,
0.093052725, 0.170908930, 0.086624752, -0.003855011, -0.195791649,
0.012126180, 0.043428961, 0.028435453, 0.075708220, 0.020358061)
## Calculate the median of the values from the subsetted vector
CNprep:::smedian(pos=position, v=values)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.