data(crime, package = "ggbiplot")
crime.num <- crime |>
tibble::column_to_rownames("st") |>
dplyr::select(where(is.numeric))
pvPlot(crime.num, vars = c("burglary", "larceny"))
pvPlot(crime.num, vars = c("auto", "robbery"))
# ellipse color independent of point color
pvPlot(crime.num, vars = c("auto", "robbery"),
ellipse.args = list(col="red"))
# styled regression line
pvPlot(crime.num, vars = c("burglary", "larceny"),
regline = list(col = "red", lwd = 3))
# partial out only a subset of the other variables
pvPlot(crime.num, vars = c("burglary", "larceny"),
others = c("murder", "rape"))
# suppress the ellipse
pvPlot(crime.num, vars = c("burglary", "larceny"), ellipse=FALSE)
# label some observations
pvPlot(crime.num, vars = c("burglary", "larceny"),
id = list(n=5),
cex.lab = 1.5)
Run the code above in your browser using DataLab