Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

The which() function will return the position of the elements(i.e., row number/column number/array index) in a logical vector which are TRUE. Unlike the other base R functions, the which() will accept only the arguments with typeof as logical while the others will give an error.

x: can be a logical vector or an array. NAs are treated as FALSE and allowed. But they will be omitted arr.ind: logical; should array indices be returned when x is an array? ind: integer-valued index vector, as resulting from which(x) .dim: integer vector .dimnames: optional list of character dimnames(.), of which only .dimnames[[1]] is used useNames: logical indicating if the value of arrayInd() should have (non-null) dimnames at all