R/tableplot_checkNcols.R

Defines functions tableplot_checkNcols

tableplot_checkNcols <- function(nCols, colNames, sortCol) {
	if (!is.numeric(nCols)) stop("<ncolums> is not numeric")
	if (nCols < length(sortCol)) stop("<nCols> less than number of sorted columns")
	if (nCols == length(sortCol) && length(sortCol) < length(colNames)) 
		stop("<nCols> equal to number of sorted columns while number of selected columns is larger")
	
	ifelse(nCols > length(colNames), length(colNames), nCols)
}

Try the tabplot package in your browser

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

tabplot documentation built on Sept. 17, 2019, 5:04 p.m.