Title: | Generate Descriptive Statistics |
---|---|
Description: | Generate descriptive statistics such as measures of location, dispersion, frequency tables, cross tables, group summaries and multiple one/two way tables. |
Authors: | Aravind Hebbali [aut, cre] |
Maintainer: | Aravind Hebbali <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.6.0.9000 |
Built: | 2024-11-08 10:17:24 UTC |
Source: | https://github.com/rsquaredacademy/descriptr |
ds_auto_freq_table
creates multiple one way tables by creating
a frequency table for each categorical variable in a data frame.
ds_auto_cross_table
creates multiple two way tables by creating a cross
table for each unique pair of categorical variables in a data frame.
ds_auto_freq_table(data, ...) ds_auto_cross_table(data, ...)
ds_auto_freq_table(data, ...) ds_auto_cross_table(data, ...)
data |
A |
... |
Column(s) in |
ds_auto_freq_table
is a extension of the ds_freq_table
function. It creates a frequency table for each categorical variable in the
dataframe. ds_auto_cross_table
is a extension of the ds_cross_table
function. It creates a two way table for each unique pair of categorical
variables in the dataframe.
ds_oway_tables()
and ds_tway_tables()
have been deprecated.
Instead use ds_auto_freq_table()
and ds_auto_cross_table()
.
link{ds_freq_table}
link{ds_cross_table}
# frequency table for all columns ds_auto_freq_table(mtcarz) # frequency table for multiple columns ds_auto_freq_table(mtcarz, cyl, gear) # cross table for all columns ds_auto_cross_table(mtcarz) # cross table for multiple columns ds_auto_cross_table(mtcarz, cyl, gear, am)
# frequency table for all columns ds_auto_freq_table(mtcarz) # frequency table for multiple columns ds_auto_freq_table(mtcarz, cyl, gear) # cross table for all columns ds_auto_cross_table(mtcarz) # cross table for multiple columns ds_auto_cross_table(mtcarz, cyl, gear, am)
Generate summary statistics for all continuous variables in data.
ds_auto_group_summary(data, ...)
ds_auto_group_summary(data, ...)
data |
A |
... |
Column(s) in |
# summary statistics of mpg & disp for each level of cyl & gear ds_auto_group_summary(mtcarz, cyl, gear, mpg, disp)
# summary statistics of mpg & disp for each level of cyl & gear ds_auto_group_summary(mtcarz, cyl, gear, mpg, disp)
Generate summary statistics & frequency table for all continuous variables in data.
ds_auto_summary_stats(data, ...)
ds_auto_summary_stats(data, ...)
data |
A |
... |
Column(s) in |
# all columns ds_auto_summary_stats(mtcarz) # multiple columns ds_auto_summary_stats(mtcarz, disp, hp)
# all columns ds_auto_summary_stats(mtcarz) # multiple columns ds_auto_summary_stats(mtcarz, disp, hp)
Creates two way tables of categorical variables. The tables created can be visualized as bar plots and mosaic plots.
ds_cross_table(data, var_1, var_2) ## S3 method for class 'ds_cross_table' plot(x, stacked = FALSE, proportional = FALSE, print_plot = TRUE, ...) ds_twoway_table(data, var_1, var_2)
ds_cross_table(data, var_1, var_2) ## S3 method for class 'ds_cross_table' plot(x, stacked = FALSE, proportional = FALSE, print_plot = TRUE, ...) ds_twoway_table(data, var_1, var_2)
data |
A |
var_1 |
First categorical variable. |
var_2 |
Second categorical variable. |
x |
An object of class |
stacked |
If |
proportional |
If |
print_plot |
logical; if |
... |
Further arguments to be passed to or from methods. |
# cross table k <- ds_cross_table(mtcarz, cyl, gear) k # bar plot plot(k) # stacked bar plot plot(k, stacked = TRUE) # proportional bar plot plot(k, proportional = TRUE) # returns tibble ds_twoway_table(mtcarz, cyl, gear)
# cross table k <- ds_cross_table(mtcarz, cyl, gear) k # bar plot plot(k) # stacked bar plot plot(k, stacked = TRUE) # proportional bar plot plot(k, proportional = TRUE) # returns tibble ds_twoway_table(mtcarz, cyl, gear)
Compute the corrected sum of squares
ds_css(data, x = NULL)
ds_css(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
# vector ds_css(mtcars$mpg) # data.frame ds_css(mtcars, mpg)
# vector ds_css(mtcars$mpg) # data.frame ds_css(mtcars, mpg)
Compute the coefficient of variation
ds_cvar(data, x = NULL)
ds_cvar(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
# vector ds_cvar(mtcars$mpg) # data.frame ds_cvar(mtcars, mpg)
# vector ds_cvar(mtcars$mpg) # data.frame ds_cvar(mtcars, mpg)
Returns the most extreme observations.
ds_extreme_obs(data, col, decimals = 2)
ds_extreme_obs(data, col, decimals = 2)
data |
A numeric vector or |
col |
Column in |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# data.frame ds_extreme_obs(mtcarz, mpg) # vector ds_extreme_obs(mtcarz$mpg) # decimal places ds_extreme_obs(mtcarz$mpg, decimals = 3)
# data.frame ds_extreme_obs(mtcarz, mpg) # vector ds_extreme_obs(mtcarz$mpg) # decimal places ds_extreme_obs(mtcarz$mpg, decimals = 3)
Frequency table for categorical and continuous data and returns the
frequency, cumulative frequency, frequency percent and cumulative frequency
percent. plot.ds_freq_table()
creates bar plot for the categorical
data and histogram for continuous data.
ds_freq_table(data, col, bins = 5) ## S3 method for class 'ds_freq_table' plot(x, print_plot = TRUE, ...)
ds_freq_table(data, col, bins = 5) ## S3 method for class 'ds_freq_table' plot(x, print_plot = TRUE, ...)
data |
A |
col |
Column in |
bins |
Number of intervals into which the data must be split. |
x |
An object of class |
print_plot |
logical; if |
... |
Further arguments to be passed to or from methods. |
# categorical data ds_freq_table(mtcarz, cyl) # barplot k <- ds_freq_table(mtcarz, cyl) plot(k) # continuous data ds_freq_table(mtcarz, mpg) # barplot k <- ds_freq_table(mtcarz, mpg) plot(k)
# categorical data ds_freq_table(mtcarz, cyl) # barplot k <- ds_freq_table(mtcarz, cyl) plot(k) # continuous data ds_freq_table(mtcarz, mpg) # barplot k <- ds_freq_table(mtcarz, mpg) plot(k)
Computes the geometric mean
ds_gmean(data, x = NULL)
ds_gmean(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
# vector ds_gmean(mtcars$mpg) # data.frame ds_gmean(mtcars, mpg)
# vector ds_gmean(mtcars$mpg) # data.frame ds_gmean(mtcars, mpg)
Descriptive statistics of a continuous variable for the different levels of
a categorical variable. boxplot.group_summary()
creates boxplots of
the continuous variable for the different levels of the categorical variable.
ds_group_summary(data, group_by, cols) ## S3 method for class 'ds_group_summary' plot(x, print_plot = TRUE, ...)
ds_group_summary(data, group_by, cols) ## S3 method for class 'ds_group_summary' plot(x, print_plot = TRUE, ...)
data |
A |
group_by |
Column in |
cols |
Column in |
x |
An object of the class |
print_plot |
logical; if |
... |
Further arguments to be passed to or from methods. |
ds_group_summary()
returns an object of class "ds_group_summary"
.
An object of class "ds_group_summary"
is a list containing the
following components:
stats |
A data frame containing descriptive statistics for the different levels of the factor variable. |
tidy_stats |
A tibble containing descriptive statistics for the different levels of the factor variable. |
plotdata |
Data for boxplot method. |
# ds_group summary ds_group_summary(mtcarz, cyl, mpg) # boxplot k <- ds_group_summary(mtcarz, cyl, mpg) plot(k) # tibble k$tidy_stats
# ds_group summary ds_group_summary(mtcarz, cyl, mpg) # boxplot k <- ds_group_summary(mtcarz, cyl, mpg) plot(k) # tibble k$tidy_stats
Descriptive statistics of a continuous variable for the combination of levels of two or more categorical variables.
ds_group_summary_interact(data, col, ...)
ds_group_summary_interact(data, col, ...)
data |
A |
col |
Column in |
... |
Columns in |
ds_group_summary_interact(mtcarz, mpg, cyl, gear)
ds_group_summary_interact(mtcarz, mpg, cyl, gear)
Computes the harmonic mean
ds_hmean(data, x = NULL)
ds_hmean(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
# vector ds_hmean(mtcars$mpg) # data.frame ds_hmean(mtcars, mpg)
# vector ds_hmean(mtcars$mpg) # data.frame ds_hmean(mtcars, mpg)
Compute the kurtosis of a probability distribution.
ds_kurtosis(data, x = NULL)
ds_kurtosis(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
Sheskin, D.J. (2000) Handbook of Parametric and Nonparametric Statistical Procedures, Second Edition. Boca Raton, Florida: Chapman & Hall/CRC.
ds_skewness
# vector ds_kurtosis(mtcars$mpg) # data.frame ds_kurtosis(mtcars, mpg)
# vector ds_kurtosis(mtcars$mpg) # data.frame ds_kurtosis(mtcars, mpg)
Launches shiny app
ds_launch_shiny_app()
ds_launch_shiny_app()
launch_descriptr()
has been deprecated. Instead
use ds_launch_shiny_app()
.
## Not run: ds_launch_shiny_app() ## End(Not run)
## Not run: ds_launch_shiny_app() ## End(Not run)
Compute the mean absolute deviation about the mean
ds_mdev(data, x = NULL)
ds_mdev(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
The ds_mdev
function computes the mean absolute deviation
about the mean. It is different from mad
in stats
package as
the statistic used to compute the deviations is not median
but
mean
. Any NA values are stripped from x
before computation
takes place
# vector ds_mdev(mtcars$mpg) # data.frame ds_mdev(mtcars, mpg)
# vector ds_mdev(mtcars$mpg) # data.frame ds_mdev(mtcars, mpg)
Returns the measures of location such as mean, median & mode.
ds_measures_location(data, ..., trim = 0.05, decimals = 2)
ds_measures_location(data, ..., trim = 0.05, decimals = 2)
data |
A |
... |
Column(s) in |
trim |
The fraction of values to be trimmed before computing the mean. |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# single column ds_measures_location(mtcarz, mpg) # multiple columns ds_measures_location(mtcarz, mpg, disp) # all columns ds_measures_location(mtcarz) # vector ds_measures_location(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_location(mtcarz$mpg, disp) # decimal places ds_measures_location(mtcarz, disp, hp, decimals = 3)
# single column ds_measures_location(mtcarz, mpg) # multiple columns ds_measures_location(mtcarz, mpg, disp) # all columns ds_measures_location(mtcarz) # vector ds_measures_location(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_location(mtcarz$mpg, disp) # decimal places ds_measures_location(mtcarz, disp, hp, decimals = 3)
Returns the measures of symmetry such as skewness and kurtosis.
ds_measures_symmetry(data, ..., decimals = 2)
ds_measures_symmetry(data, ..., decimals = 2)
data |
A |
... |
Column(s) in |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# single column ds_measures_symmetry(mtcarz, mpg) # multiple columns ds_measures_symmetry(mtcarz, mpg, disp) # all columns ds_measures_symmetry(mtcarz) # vector ds_measures_symmetry(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_symmetry(mtcarz$mpg, disp) # decimal places ds_measures_symmetry(mtcarz, disp, hp, decimals = 3)
# single column ds_measures_symmetry(mtcarz, mpg) # multiple columns ds_measures_symmetry(mtcarz, mpg, disp) # all columns ds_measures_symmetry(mtcarz) # vector ds_measures_symmetry(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_symmetry(mtcarz$mpg, disp) # decimal places ds_measures_symmetry(mtcarz, disp, hp, decimals = 3)
Returns the measures of location such as range, variance and standard deviation.
ds_measures_variation(data, ..., decimals = 2)
ds_measures_variation(data, ..., decimals = 2)
data |
A |
... |
Column(s) in |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# single column ds_measures_variation(mtcarz, mpg) # multiple columns ds_measures_variation(mtcarz, mpg, disp) # all columns ds_measures_variation(mtcarz) # vector ds_measures_variation(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_variation(mtcarz$mpg, disp) # decimal places ds_measures_variation(mtcarz, disp, hp, decimals = 3)
# single column ds_measures_variation(mtcarz, mpg) # multiple columns ds_measures_variation(mtcarz, mpg, disp) # all columns ds_measures_variation(mtcarz) # vector ds_measures_variation(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_measures_variation(mtcarz$mpg, disp) # decimal places ds_measures_variation(mtcarz, disp, hp, decimals = 3)
Compute the sample mode
ds_mode(data, x = NULL)
ds_mode(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
Any NA values are stripped from x
before computation
takes place.
Mode of x
# vector ds_mode(mtcars$mpg) # data.frame ds_mode(mtcars, mpg)
# vector ds_mode(mtcars$mpg) # data.frame ds_mode(mtcars, mpg)
Returns the percentiles
ds_percentiles(data, ..., decimals = 2)
ds_percentiles(data, ..., decimals = 2)
data |
A |
... |
Column(s) in |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
# single column ds_percentiles(mtcarz, mpg) # multiple columns ds_percentiles(mtcarz, mpg, disp) # all columns ds_percentiles(mtcarz) # vector ds_percentiles(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_percentiles(mtcarz$mpg, disp) # decimal places ds_percentiles(mtcarz, disp, hp, decimals = 3)
# single column ds_percentiles(mtcarz, mpg) # multiple columns ds_percentiles(mtcarz, mpg, disp) # all columns ds_percentiles(mtcarz) # vector ds_percentiles(mtcarz$mpg) # vectors of different length disp <- mtcarz$disp[1:10] ds_percentiles(mtcarz$mpg, disp) # decimal places ds_percentiles(mtcarz, disp, hp, decimals = 3)
Creates bar plots if the data has categorical variables.
ds_plot_bar(data, ..., fill = "blue", print_plot = TRUE)
ds_plot_bar(data, ..., fill = "blue", print_plot = TRUE)
data |
A |
... |
Column(s) in |
fill |
Color of the bars. |
print_plot |
logical; if |
# plot single variable ds_plot_bar(mtcarz, cyl) # plot multiple variables ds_plot_bar(mtcarz, cyl, gear) # plot all variables ds_plot_bar(mtcarz)
# plot single variable ds_plot_bar(mtcarz, cyl) # plot multiple variables ds_plot_bar(mtcarz, cyl, gear) # plot all variables ds_plot_bar(mtcarz)
Creates grouped bar plots if the data has categorical variables.
ds_plot_bar_grouped(data, ..., print_plot = TRUE)
ds_plot_bar_grouped(data, ..., print_plot = TRUE)
data |
A |
... |
Column(s) in |
print_plot |
logical; if |
# subset data mt <- dplyr::select(mtcarz, cyl, gear, am) # grouped bar plot ds_plot_bar_grouped(mtcarz, cyl, gear) # plot all variables ds_plot_bar_grouped(mt)
# subset data mt <- dplyr::select(mtcarz, cyl, gear, am) # grouped bar plot ds_plot_bar_grouped(mtcarz, cyl, gear) # plot all variables ds_plot_bar_grouped(mt)
Creates stacked bar plots if the data has categorical variables.
ds_plot_bar_stacked(data, ..., print_plot = TRUE)
ds_plot_bar_stacked(data, ..., print_plot = TRUE)
data |
A |
... |
Column(s) in |
print_plot |
logical; if |
# subset data mt <- dplyr::select(mtcarz, cyl, gear, am) # stacked bar plot ds_plot_bar_stacked(mtcarz, cyl, gear) # plot all variables ds_plot_bar_stacked(mt)
# subset data mt <- dplyr::select(mtcarz, cyl, gear, am) # stacked bar plot ds_plot_bar_stacked(mtcarz, cyl, gear) # plot all variables ds_plot_bar_stacked(mt)
Creates box plots if the data has both categorical & continuous variables.
ds_plot_box_group(data, ..., print_plot = TRUE)
ds_plot_box_group(data, ..., print_plot = TRUE)
data |
A |
... |
Column(s) in |
print_plot |
logical; if |
# subset data mt <- dplyr::select(mtcarz, cyl, disp, mpg) # plot select variables ds_plot_box_group(mtcarz, cyl, gear, mpg) # plot all variables ds_plot_box_group(mt)
# subset data mt <- dplyr::select(mtcarz, cyl, disp, mpg) # plot select variables ds_plot_box_group(mtcarz, cyl, gear, mpg) # plot all variables ds_plot_box_group(mt)
Creates box plots if the data has continuous variables.
ds_plot_box_single(data, ..., print_plot = TRUE)
ds_plot_box_single(data, ..., print_plot = TRUE)
data |
A |
... |
Column(s) in |
print_plot |
logical; if |
# plot single variable ds_plot_box_single(mtcarz, mpg) # plot multiple variables ds_plot_box_single(mtcarz, mpg, disp, hp) # plot all variables ds_plot_box_single(mtcarz)
# plot single variable ds_plot_box_single(mtcarz, mpg) # plot multiple variables ds_plot_box_single(mtcarz, mpg, disp, hp) # plot all variables ds_plot_box_single(mtcarz)
Creates density plots if the data has continuous variables.
ds_plot_density(data, ..., color = "blue", print_plot = TRUE)
ds_plot_density(data, ..., color = "blue", print_plot = TRUE)
data |
A |
... |
Column(s) in |
color |
Color of the plot. |
print_plot |
logical; if |
# plot single variable ds_plot_density(mtcarz, mpg) # plot multiple variables ds_plot_density(mtcarz, mpg, disp, hp) # plot all variables ds_plot_density(mtcarz)
# plot single variable ds_plot_density(mtcarz, mpg) # plot multiple variables ds_plot_density(mtcarz, mpg, disp, hp) # plot all variables ds_plot_density(mtcarz)
Creates histograms if the data has continuous variables.
ds_plot_histogram(data, ..., bins = 5, fill = "blue", print_plot = TRUE)
ds_plot_histogram(data, ..., bins = 5, fill = "blue", print_plot = TRUE)
data |
A |
... |
Column(s) in |
bins |
Number of bins in the histogram. |
fill |
Color of the histogram. |
print_plot |
logical; if |
# plot single variable ds_plot_histogram(mtcarz, mpg) # plot multiple variables ds_plot_histogram(mtcarz, mpg, disp, hp) # plot all variables ds_plot_histogram(mtcarz)
# plot single variable ds_plot_histogram(mtcarz, mpg) # plot multiple variables ds_plot_histogram(mtcarz, mpg, disp, hp) # plot all variables ds_plot_histogram(mtcarz)
Creates scatter plots if the data has continuous variables.
ds_plot_scatter(data, ..., print_plot = TRUE)
ds_plot_scatter(data, ..., print_plot = TRUE)
data |
A |
... |
Column(s) in |
print_plot |
logical; if |
# plot select variables ds_plot_scatter(mtcarz, mpg, disp) # plot all variables ds_plot_scatter(mtcarz)
# plot select variables ds_plot_scatter(mtcarz, mpg, disp) # plot all variables ds_plot_scatter(mtcarz)
Compute the range of a numeric vector
ds_range(data, x = NULL)
ds_range(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
Range of x
# vector ds_range(mtcars$mpg) # data.frame ds_range(mtcars, mpg)
# vector ds_range(mtcars$mpg) # data.frame ds_range(mtcars, mpg)
Returns index of values.
ds_rindex(data, values)
ds_rindex(data, values)
data |
a numeric vector |
values |
a numeric vector containing the values whose index is returned |
Index of the values
in data
. In case, data
does
not contain index
, NULL
is returned.
# returns index of 21 ds_rindex(mtcars$mpg, 21) # returns NULL ds_rindex(mtcars$mpg, 22)
# returns index of 21 ds_rindex(mtcars$mpg, 21) # returns NULL ds_rindex(mtcars$mpg, 22)
Screen data and return details such as variable names, class, levels and
missing values. plot.ds_screener()
creates bar plots to visualize
of missing observations for each variable in a data set.
ds_screener(data) ## S3 method for class 'ds_screener' plot(x, ...)
ds_screener(data) ## S3 method for class 'ds_screener' plot(x, ...)
data |
A |
x |
An object of class |
... |
Further arguments to be passed to or from methods. |
ds_screener()
returns an object of class "ds_screener"
.
An object of class "ds_screener"
is a list containing the
following components:
Rows |
Number of rows in the data frame. |
Columns |
Number of columns in the data frame. |
Variables |
Names of the variables in the data frame. |
Types |
Class of the variables in the data frame. |
Count |
Length of the variables in the data frame. |
nlevels |
Number of levels of a factor variable. |
levels |
Levels of factor variables in the data frame. |
Missing |
Number of missing observations in each variable. |
MissingPer |
Percent of missing observations in each variable. |
MissingTotal |
Total number of missing observations in the data frame. |
MissingTotPer |
Total percent of missing observations in the data frame. |
MissingRows |
Total number of rows with missing observations in the data frame. |
MissingCols |
Total number of columns with missing observations in the data frame. |
# screen data ds_screener(mtcarz) ds_screener(airquality) # plot x <- ds_screener(airquality) plot(x)
# screen data ds_screener(mtcarz) ds_screener(airquality) # plot x <- ds_screener(airquality) plot(x)
Compute the skewness of a probability distribution.
ds_skewness(data, x = NULL)
ds_skewness(data, x = NULL)
data |
A numeric vector or |
x |
Column in |
Sheskin, D.J. (2000) Handbook of Parametric and Nonparametric Statistical Procedures, Second Edition. Boca Raton, Florida: Chapman & Hall/CRC.
kurtosis
# vector ds_skewness(mtcars$mpg) # data.frame ds_skewness(mtcars, mpg)
# vector ds_skewness(mtcars$mpg) # data.frame ds_skewness(mtcars, mpg)
Returns the standard error of mean.
ds_std_error(x)
ds_std_error(x)
x |
A numeric vector. |
ds_std_error(mtcars$mpg)
ds_std_error(mtcars$mpg)
Range of descriptive statistics for continuous data.
ds_summary_stats(data, ...)
ds_summary_stats(data, ...)
data |
An object of type |
... |
Column(s) in |
summary
ds_freq_table
ds_cross_table
# numeric data ds_summary_stats(mtcarz$mpg) # single variable ds_summary_stats(mtcarz, mpg) # multiple variables ds_summary_stats(mtcarz, mpg, disp, hp) # all variables ds_summary_stats(mtcarz)
# numeric data ds_summary_stats(mtcarz$mpg) # single variable ds_summary_stats(mtcarz, mpg) # multiple variables ds_summary_stats(mtcarz, mpg, disp, hp) # all variables ds_summary_stats(mtcarz)
Returns the n highest/lowest observations from a numeric vector.
ds_tailobs(data, n, type = c("low", "high"), decimals = 2)
ds_tailobs(data, n, type = c("low", "high"), decimals = 2)
data |
a numeric vector |
n |
number of observations to be returned |
type |
if |
decimals |
An option to specify the exact number of decimal places to use. The default number of decimal places is 2. |
Any NA values are stripped from data
before computation takes place.
n
highest/lowest observations from data
# 5 lowest observations ds_tailobs(mtcarz$mpg, 5) # 5 highest observations ds_tailobs(mtcarz$mpg, 5, type = "high") # specify decimal places to display ds_tailobs(mtcarz$mpg, 5, decimals = 3)
# 5 lowest observations ds_tailobs(mtcarz$mpg, 5) # 5 highest observations ds_tailobs(mtcarz$mpg, 5, type = "high") # specify decimal places to display ds_tailobs(mtcarz$mpg, 5, decimals = 3)
Descriptive statistics for multiple variables.
ds_tidy_stats(data, ...)
ds_tidy_stats(data, ...)
data |
A |
... |
Columns in |
A tibble.
ds_multi_stats()
have been deprecated. Instead use ds_tidy_stats()
.
# all columns ds_tidy_stats(mtcarz) # multiple columns ds_tidy_stats(mtcarz, mpg, disp, hp)
# all columns ds_tidy_stats(mtcarz) # multiple columns ds_tidy_stats(mtcarz, mpg, disp, hp)
A dataset containing demographic information and standardized test scores of high school students.
hsb
hsb
A data frame with 200 rows and 10 variables:
id of the student
gender of the student
ethnic background of the student
socio-economic status of the student
school type
program type
scores from test of reading
scores from test of writing
scores from test of math
scores from test of science
scores from test of social studies
https://nces.ed.gov/surveys/hsb/
Copy of mtcars data set with modified variable types
mtcarz
mtcarz
An object of class data.frame
with 32 rows and 11 columns.