[RkWard-devel] length() and na.rm

Thomas Friedrichsmeier thomas.friedrichsmeier at ruhr-uni-bochum.de
Wed Aug 16 14:37:13 UTC 2006


Hi,

On Tuesday 15 August 2006 16:41, Stefan Rödiger wrote:
> I tried to add length() to Descriptive statistics. But I stumbled over
> something rather simple. How can I strip NAs from numeric columns? length()
> does not support the the na.rm=T argument.

you could use

length (na.omit (x))

Slightly more complicated to add in the plugins than simple options, as you'll 
acutally have to use some simple php-logic to add "na.omit (" before and ")" 
after the variable name.

Something like

function printout () {
	$xvalue = getRK_val ("x");
	if (getRK_val ("omitnas") == "1") {	
		// you'd use "1" as the value when checked for the "omitnas"-option
	
		$xvalue = "na.omit (" . $xvalue . ")";
	}
	echo ('length ("' . $xvalue . '")');
}

Let me know, if you need more instructions.

Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20060816/3afa53ef/attachment.sig>


More information about the Rkward-devel mailing list