HI
I want to remove an element from a list or character. i can any of the class
type
like
cat= [1] "mac" "med"
if my input is 2 i need to remove med and if my input is one i need to
remove mac from cat
Please help
-----
Thanks in Advance
Arun
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-remove-an-element-from-list-or-character-tp4268556p4268556.html
Sent from the R help mailing list archive at Nabble.com.
Milan Bouchet-Valat
2012-Jan-06 10:05 UTC
[R] how to remove an element from list or character
Le jeudi 05 janvier 2012 ? 23:52 -0800, arunkumar1111 a ?crit :> HI > > I want to remove an element from a list or character. i can any of the class > type > > like > > cat= [1] "mac" "med" > > if my input is 2 i need to remove med and if my input is one i need to > remove mac from catThis is really basic, please read the R intro or some tutorial. Basically, you can do: input <- 1 (or input <- 2) cat <- cat[-input] Cheers