Description Usage Arguments Details Value Author(s) References See Also Examples
It describes data using R basic functions, without calling other packages to avoid redundant calculations, which is faster.
1 |
data |
A data frame to describe, from the column |
start |
The column number of the first variable to describe. |
end |
The column number of the last variable to describe. |
stats |
Selecting or rearranging the items from the 9 statistics, i.e., n, na, mean, sd, median, trimmed, min, max, and IQR. It can be a vector or a single value, in 'character' or 'numeric' class. |
first |
The name of the first column of the output. It is the general name of the items (variables). |
This function can be used for different types of data, as long as the variables are numeric. Because it describes the data frame from the column start
to the column end
, the variables need to be linked together instead of being scattered.
A data frame of descriptive statistics:
size |
default general name of items (variables). Users can define it via the parameter first. |
n |
number of valid cases |
na |
number of invalid cases |
mean |
mean of each item |
sd |
standard deviation |
median |
median of each item |
trimmed |
trimmed mean (with trim defaulting to .1) |
min |
minimum of each item |
max |
maximum of each item |
IQR |
interquartile range of each item |
Chun-Sheng Liang <liangchunsheng@lzu.edu.cn>
1. Example data is from https://smear.avaa.csc.fi/download. It includes particle number concentrations in SMEAR I Varrio forest.
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Variable names are essentially numeric
descdata(data,5,65)
# Use numbers to select statistics
descdata(data,5,65,c(2,7:9))
# Use characters to select statistics
descdata(data,5,65,c('na','min','max','IQR'))
# When type of variable names is character
descdata(data1,3,7)
# Use numbers to select statistics
descdata(data1,3,7,c(2,7:9))
# Use characters to select statistics
descdata(data1,3,7,c('na','min','max','IQR'))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.