| plotpolygon {kpeaks} | R Documentation |
Plots the frequency polygon and histogram of a feature with some options.
plotpolygon(x, nbins, ptype, bcol = "gray", pcol = "blue")
x |
a numeric vector containing the observations of a feature, or a numeric matrix when |
nbins |
an integer for the number of classes in the frequency polygon. |
bcol |
a string for the color of bins. Default is gray. |
pcol |
a string for the color of polygon lines. Default is blue. |
ptype |
a string specifying the type of plot. Use p for plotting the polygon only or ph for plotting the polygon with the histogram. Default is sp for the scatterplots between the pairs of features and the polygons on the diagonal panel. |
Zeynel Cebeci, Cagatay Cebeci
# plot the frequency polygon of the 2nd feature in x5p4c data set data(x5p4c) hvals <- genpolygon(x5p4c[,2], binrule="usr", nbins=20) # plot the frequency polygon of the 2nd feature in x5p4c data set plotpolygon(x5p4c[,2], nbins=hvals$nbins, ptype="p") # plot the histogram and frequency polygon of the 2nd feature in x5p4c data set plotpolygon(x5p4c[,2], nbins=hvals$nbins, ptype="ph", bcol="orange", pcol="blue") # plot the pairwise scatter plots of the features in x5p4c data set pairs(x5p4c, diag.panel=plotpolygon, upper.panel=NULL, cex.labels=1.5) # plot the histogram and frequency polygon of Petal.Width in iris data set data(iris) hvals <- genpolygon(iris$Petal.Width, binrule="doane") plotpolygon(iris$Petal.Width, nbins=hvals$nbins, ptype="ph")