freqC: Generates table and figure describing distribution of...

Description Usage Arguments Value Examples

View source: R/freqC.r

Description

Generates frequency distribution table and bar chart to describe distribution of variable values. Based on freq function in descr package.

Usage

1
freqC(x, w, plot = TRUE)

Arguments

x

A vector of variable values, should be in form dataset$var

w

Sample weights (optional), should be in form dataset$weighvar

plot

Do you want a bar chart? (default set to TRUE)

Value

A frequency distribution table (a "freqtable" and "matrix" class object)

Examples

1
2
3
4
5
   library(poliscidata)
   
   freqC(gss$zodiac, gss$wtss)
   
   freqC(x=gss$zodiac, w=gss$wtss)

Example output

x 
            Frequency Percent Valid Percent
ARIES          145.78   7.381         7.649
TAURUS         171.59   8.688         9.003
GEMINI         161.40   8.172         8.469
CANCER         147.73   7.480         7.751
LEO            190.35   9.638         9.988
VIRGO          158.58   8.029         8.321
LIBRA          183.37   9.285         9.621
SCORPIO        145.12   7.348         7.614
SAGITTARIUS    145.36   7.360         7.627
CAPRICORN      140.29   7.104         7.361
AQUARIUS       173.52   8.786         9.104
PISCES         142.78   7.229         7.492
NA's            69.14   3.501              
Total         1975.00 100.000       100.000
x 
            Frequency Percent Valid Percent
ARIES          145.78   7.381         7.649
TAURUS         171.59   8.688         9.003
GEMINI         161.40   8.172         8.469
CANCER         147.73   7.480         7.751
LEO            190.35   9.638         9.988
VIRGO          158.58   8.029         8.321
LIBRA          183.37   9.285         9.621
SCORPIO        145.12   7.348         7.614
SAGITTARIUS    145.36   7.360         7.627
CAPRICORN      140.29   7.104         7.361
AQUARIUS       173.52   8.786         9.104
PISCES         142.78   7.229         7.492
NA's            69.14   3.501              
Total         1975.00 100.000       100.000

poliscidata documentation built on July 8, 2020, 6:23 p.m.