R/setcolalpha.R

# file  ~/sintro/R/setcolalpha.R 
# $Date: 2015-07-21 13:34:22 +0200 (Tue, 21 Jul 2015) $
# $Rev: 264 $
# $ID:$
# $URL: file:///srv/svn/sintro/pkg/sintro/R/setcolalpha.R $

#! improve control over input formats

setcolalpha <- function(col, alpha='#40') {
	ifelse(nchar(col)==7, col <- paste(col, substr(alpha,2,3), sep='') ,
		ifelse (nchar(col)==9, {substr(col,8,9) <- substr(alpha,2,3)} ,		
			stop('setcolapha: col must be 7 or 9 character code')
	)
	)
		col
} #col

Try the sintro package in your browser

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

sintro documentation built on May 2, 2019, 5:26 p.m.