Learn R Programming

datplot (version 1.0.0)

get.histogramscale: Scaling Factor for Combined Histogramm Plots

Description

Requires a dataframe as produced by datsteps() or a number as DAT_df_steps. Calculated the value with which the y-axis of a density graph should be multiplied in order to be visible in the corresponding histogram.

Usage

get.histogramscale(DAT_df_steps, binwidth = "stepsize")

Arguments

DAT_df_steps

a dataframe as returned by datsteps (works also with a single number and a vector)

binwidth

the bandwidth to use for the density function and histogram. Should be stepsize used to create the dataframe. If a df as returned by datsteps() is given, stepsize can be automatically assigned using the corresponding attribute (binwidth = "stepsize")

Value

the value with which to scale the density curve to a histogram plot so that both will be visible

Examples

Run this code
# NOT RUN {
DAT_df_steps <- datsteps(DAT_df[1:100, ], stepsize = 25)
get.histogramscale(DAT_df_steps)

get.histogramscale(DAT_df_steps$DAT_step, binwidth = 20)
get.histogramscale(500, binwidth = 20)

# }

Run the code above in your browser using DataLab