This is a explainer
method for numeric vector.
# S3 method for numeric
explainer(
X,
xname = NULL,
include.numeric = NULL,
round.digit = 2,
quant.seq = seq(0, 1, 0.2),
trim = 0.05,
...
)
a numeric (or integer) data type
a placeholder for variable name
a vector having strings which is also required along with the default output. Can have values:
trimmed.means
for printing the trimmed mean after removing
trim
fraction of data from each side of x. trim
can be passed
as an parameter
skewness
for printing the skewness of the data.
Use ?skreness
for more information
kurtosis
for printing
the kurtosis of the data. Use ?kurtosis
for more information
number of decimal places required in the output.
vector of fractions (0 to 1) for which the quantiles are
required 0.5
means median, 0
means smallest observation and
1
means largest observation
the fraction (0 to 0.5) of observations to be trimmed from each
end of x before the mean is computed. Values of trim outside that range are
taken as the nearest endpoint. This only works if include.numeric
has
a string 'trimmed.means'
other parameters required
Prints the following information on console:
vector name
type
number of distinct values
number of missing values
mean
sd (standard deviation)
median
quantiles based on quant.seq
parameter
other information based on include.numeric
a box plot (only if number distinct numbers are > 2).
If counts of all the factor levels are less than half of length of
x
, then the histogram is scaled with maximum of 50
?consoleBoxplot
for how to read the table and histogram)
a frequency table and histogram (only if number of distinct
numbers are < 11)
(look at ?freqTable
for how to read the table and histogram)
This method removes all the missing values in x
before computing the
summaries.
# NOT RUN {
explainer(mtcars$mpg)
explainer(mtcars$mpg, include.numeric = c('trimmed.means', 'skewness',
'kurtosis'), round.digit = 1, quant.seq = seq(0,1,0.1), trim = 0.05)
# }
Run the code above in your browser using DataLab