R/starmaker.r

Defines functions starmaker

Documented in starmaker

starmaker <- function(x, p.levels=c(.001, .01, .05, .1), symbols=c("***", "**", "*", "+")){
  if(length(p.levels)!=length(symbols))
    stop("p.levels and symbols must have the same number of items")
  symbols <- c(symbols, "")
  as.character(cut(abs(x), c(-99999, p.levels, 99999), labels=symbols))
}

Try the weights package in your browser

Any scripts or data that you put into this service are public.

weights documentation built on June 11, 2021, 1:06 a.m.