Learn R Programming

jmuOutlier (version 2.2)

lineGraph: Line Graph Plotting

Description

Constructs a line graph.

Usage

lineGraph(x, freq = TRUE, prob = NULL, col = "red", ...)

Arguments

x

Vector of numerical observations to be graphed.

freq

Logical; if freq is FALSE or prob sums to 1, then relative frequencies are graphed; otherwise, frequencies are graphed.

prob

Vector of the probabilities or weights on x, and does not need to sum to one. If prob is NULL, then all x values are equally weighted. Also, see freq.

col

The color of the plotted lines. Type colors() for selections.

Optional arguments to plot.

See Also

hist

Examples

Run this code
# NOT RUN {
par( mfrow=c(2,2) )
lineGraph( c( rep(6,4), rep(9,7), rep(3,5), 5, 8, 8 ) )
lineGraph( c( rep(6,4), rep(9,7), rep(3,5), 5, 8, 8 ), FALSE, col="purple" )
lineGraph( 11:14, , c( 12, 9, 17, 5 ), col="blue" )
lineGraph( 0:10, FALSE, dbinom(0:10,10,0.4), col="darkgreen", 
   main="Binomial(n=10,p=0.4) probabilities" )
par( mfrow=c(1,1) )
# }

Run the code above in your browser using DataLab