[R] mardia's test

Dirk Eddelbuettel edd at debian.org
Sat Jun 16 23:20:00 CEST 2007


On 16 June 2007 at 16:50, Jiao Yang wrote:
| In the R code of Mardia's test, what does the line " x1 = x[x[, p] == i, -p]" mean?  Thanks a lot!

Read it from the inside out:

	x[, p] == i		find elements of column p in x that equal i
				the result is an vector of true/false

	x[x[, p] == i,		which is used here to subset those rows in x

	x[x[, p] == i, -p]	and the -p selects all column but the p-ths

Hth, Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison



More information about the R-help mailing list