freqWH: Distribution of frequency

Description Usage Arguments Details Value Examples

View source: R/freqWH.R

Description

Function used to compute the absolute and relative frecuency of a categorical variable.

Usage

1
freqWH(x, op = FALSE)

Arguments

x

Numeric or Character. A vector of the data set.

op

Logical. Optional argument to see the data structure in graphical representation.

Details

This function shows a table including the frequency of values from a categorical vector. This vector can be formed by numeric, character or mixed values, that is, numerical and character values. The table also includes the number of categories in which data is distributed. The absolute and relative frecuencies can be showed using histogram.

Value

A data frame is returned by default (op=FALSE), including the absolute and relative frequeincies of the data set. In addition, cumulative fequencies are included in this table. When "op=TRUE", the function returns only the absolute and relative frequencies in a graphical representation through histogram.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
#Example 1
data1=c("A","A","A","A",2,3,2,3,"B","B","B")   
freqWH(data1)
#Example 2
data2=c("A","A","B","A","C")
freqWH(data2)
#Example 3
data3=c(5,5,3,1,5,2,3,6,9,6,6)
freqWH(data3)
#Example 4
data4=c("A1","A2","B3","A2","C")
freqWH(data4)

DescriptiveWH documentation built on June 17, 2021, 9:06 a.m.