Learn R Programming

descriptr (version 0.1.0)

freq_cont: Frequency Distribution of Continuous Data

Description

freq_cont returns the frequency distribution of continuous by splitting the data into equidistant intervals created based on the number of bins specified. hist.freq_cont creates histogram for the frequency table created using freq_cont

Usage

freq_cont(data, bins = 5)

# S3 method for freq_cont hist(x, col = "blue", ...)

Arguments

data

numeric vector

bins

number of intervals into which the data must be split

x

an object of class freq_cont

col

color of the bars

...

further arguments to be passed to or from methods

Value

freq_cont returns an object of class "freq_cont" An object of class "freq_cont" is a list containing the following components

breaks

lower/upper boundaries of intervals

frequency

frequecy of the intervals

cumulative

cumulative frequency

percent

frequency as percent

cum_percent

cumulative frequency as percent

bins

bins

data

data

varname

name of the data

See Also

link{freq_table} link{cross_table}

Examples

Run this code
# frequency table
freq_cont(mtcars$mpg, 4)

# histogram
k <- freq_cont(mtcars$mpg, 4)
hist(k)

Run the code above in your browser using DataLab