Professional Documents
Culture Documents
plot(iris)
plot(iris$SLen)
plot(iris$SLen, type = "l")
plot(iris$SLen, type = "s", main = "Iris Sepal Length")
plot(iris$SLen, type = "s", main = "Iris Sepal Length", xlab = "Length", ylab = "Rec
Number")
#boxplot
#barplot
#histogram
plot(iris$Sepal.Width)
barplot(iris$Sepal.Width,
horiz=TRUE, xlab = "Frequency",
ylab="Value",col = "green",
main = "IRIS Sepal Width Dataset")
# HELP ON PLOTS
?plot
# Quickest Method
plot(chickwts$feed) # Plot feed from chickwts
?plot
# Modify histogram
h <- hist(lynx, # Save histogram as object
breaks = 11, # "Suggests" 11 bins
# breaks = seq(0, 7000, by = 100),
# breaks = c(0, 100, 300, 500, 3000, 3500, 7000),
freq = FALSE,
col = "thistle1", # Or use: col = colors() [626]
main = "Histogram of Annual Canadian Lynx Trappings\n1821-1934",
xlab = "Number of Lynx Trapped")
PLOT
Generic X-Y Plotting
Generic function for plotting of R objects. For more details about the graphical parameter arguments, see par.
For simple scatter plots, plot.default will be used. However, there are plot methods for many R objects,
including functions, data.frames, density objects, etc. Use methods(plot) and the documentation for these.
Keywords hplot
Usage plot(x, y, …)
Arguments
x : the coordinates of points in the plot. Alternatively, a single plotting structure, function or any R object with
a plot method can be provided.
y : the y coordinates of points in the plot, optional if x is an appropriate structure.
… : Arguments to be passed to methods, such as graphical parameters (see par). Many methods will accept the
following arguments: