[R] what does negative indexing in a matrix mean?

Stephan Kolassa Stephan.Kolassa at gmx.de
Wed Nov 12 18:46:27 CET 2008


"take all of the matrix *except* those indices", so XW4[,-2] is the 
matrix XW4 with the 2nd column *deleted*.

Cheers,
Stephan


Itziar Frades Alzueta schrieb:
> Hi,
> 
> Does anyone know what the negative indexing of a matrix mean?
> 
>  
> 
> I am using the RWeka and this evaluate classifier does not work on new
> data like this
> 
>  
> 
> e <- evaluate_Weka_classifier(m1235,newdata=XW4, complexity =
> FALSE,class = FALSE) 
> 
>  
> 
> while it work with negative indexing:
> 
>  
> 
> e <- evaluate_Weka_classifier(m1235,newdata=XW4[,-2], complexity =
> FALSE,class = FALSE)
> 
>  
> 
> Although I do not understand what negative indexing of a matrix means,
> or whether it produces any transformation.
> 
>  
> 
> Regards,
> 
>  
> 
> Itziar Frades
> 
> 
>  
>  
>  
> This e-mail is from CIC bioGUNE. The e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorised dissemination or copying of this e-mail or its attachments, and any use or disclosure of any information contained in them, is strictly prohibited and may be illegal. If you have received this e-mail in error, please notify or telephone + 34 944 06 13 00 and delete it from your system.
> 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list