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 cat This is really basic, please read the R intro or some tutorial.
Basically, you can do: input <- 1 (or input <- 2) cat <- cat[-input] Cheers ______________________________________________ R-help@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.