R/rg-remove-na.R

"rg.remove.na" <- 
function(xx)
{
	# Function to remove NAs from a vector and inform the user of how many.
	#
	nna <- 0
	wna <- is.na(xx)
	if(any(wna)) {
		x <- xx[!wna]
		nna <- sum(wna)
	#	cat(" ", nna, "NA (missing) values removed from input vector\n")
	}
	else x <- xx
	invisible(list(x = x, nna = nna))
}

Try the StatDA package in your browser

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

StatDA documentation built on June 7, 2023, 6:26 p.m.