Learn R Programming

DescriptiveStats.OBeu (version 1.3.2)

ds.statistics: Calculation of the Statistic Measures

Description

This function calculates the basic descriptive measures of the input dataset.

Usage

ds.statistics(data, tojson = FALSE)

Arguments

data

A numeric vector, matrix or data frame

tojson

If TRUE the results are returned in json format, default returns a list

Value

A list or json file with the following components:

  • Min The minimum observed value of the input data

  • Max The maximum observed value of the input data

  • Range The range, defined as the difference of the maximum and the minimum value.

  • Mean The average value of the input data

  • Median The median value of the input data

  • Quantiles The 25% and 75% percentiles

  • Variance The variance of the input data

  • Standard Deviation The standard deviation of the input data

  • Skewness The Skewness of the input data

  • Kurtosis The Kurtosis of the input data

Details

This function returns the following values of the input data: minimum, maximum, range, mean, median, first and third quantiles, variance, standart deviation, skewness and kurtosis.

See Also

open_spending.ds

Examples

Run this code
# NOT RUN {
# with matrix as an input and json outpout
Matrix <- cbind(Uni05 = (1:200)/21, Norm = rnorm(200),
        `5T` = rt(200, df = 5), Gam2 = rgamma(200, shape = 2))
ds.statistics(Matrix, tojson = TRUE)

# with vector as an input
vec <- as.vector(iris$Sepal.Width)
ds.statistics(vec, tojson = FALSE)

# with iris data frame as an input
ds.statistics(iris, tojson = FALSE)

# OpenBudgets.eu Dataset Example:
ds.statistics(Wuppertal_df$Amount, tojson = TRUE)

# }

Run the code above in your browser using DataLab