ppoints(4) # the same as ppoints(1:4)
ppoints(10)
ppoints(10, a = 1/2)
## Visualize including the fractions :
require(graphics)
p.ppoints <- function(n, ..., add = FALSE, col = par("col")) {
pn <- ppoints(n, ...)
if(add)
points(pn, pn, col = col)
else {
tit <- match.call(); tit[[1]] <- quote(ppoints)
plot(pn,pn, main = deparse(tit), col=col,
xlim = 0:1, ylim = 0:1, xaxs = "i", yaxs = "i")
abline(0, 1, col = adjustcolor(1, 1/4), lty = 3)
}
if(!add && requireNamespace("MASS", quietly = TRUE))
text(pn, pn, as.character(MASS::fractions(pn)),
adj = c(0,0)-1/4, cex = 3/4, xpd = NA, col=col)
abline(h = pn, v = pn, col = adjustcolor(col, 1/2), lty = 2, lwd = 1/2)
}
p.ppoints(4)
p.ppoints(10)
p.ppoints(10, a = 1/2)
p.ppoints(21)
p.ppoints(8) ; p.ppoints(8, a = 1/2, add=TRUE, col="tomato")
Run the code above in your browser using DataLab