Generating Random Numbers:
rnorm: generate random Normal variates with a given mean and standard deviation
dnorm: evaluate the Normal probability density(with a given mean/SD) at apoint(or vector of points)
pnorm: evaluate the cumulative distribution function for a Normal distribution
rpois: generate random Poisson variates with a given rate
set.seed: reproducibility
sample: used to draw random samples from arbitrary vectors
distributionfunctions prefix:
d for density密度分步
r for random number generation随机数生成
p for cumulative distribution累积分步
q for quantile function分位数
SomeImportant Base Graphics Parameters:
pch: the plotting symbol
lty: the line type
lwd: the line width
col: the plotting color
las: the orientation of the axis labels on the plot
bg: the background color
mar: the margin size
oma: the outer margin size
mfrow: number of plots per row,column(plots are filled row-wise)
nfcol: number of plots per row,column(plots are filled column-wise)
SomeImportant Base Plotting Functions:
plot: make a scatterplot, or othe type of plot depending on the class of theobject being plotted
lines: add lines to a plot, given a vector x values and a corresponding vectorof y values(or a 2-column matrix); this funcion just connects the dots
points: add points to a plot
text: add text labels to a plot using specified x, y coordinates
title: add annotations to x, y axis labels, title, subtitle, outer margin
mtext: add arbitrary text to the margins(inner or outer) of the plot
axis: add axis ticks/labels
LatticeFunctions:
xyplot: this is the main function for creating scatterplots
bwplot: box-and-whiskers plots("boxplots")
histogram: histograms
stripplot: like a boxplot but with actual points
dotplot: plot dots on "violon strings"
splom: scatterplot matrix; like pairs in base graphics system
levelplot, contourplot: for plotting "image" data