chuan_zl wrote:

> Dear All.
>
> I am Chuan. I am beginner for R.I facing some problem in remove element from
> vector.I have a vector with size 238 element as follow(a part)
>
> [1] 0 18 24 33 44..................................[238] 255
>
> Let the vector label as "x",I want remove element "0" and "255".I try use
> such function:
>
> x[x>0 & x<255]

Hi Chuan,
If you want to remove the specific values 0 and 255 from your vector, try:

x<-x[-which(x %in% c(0,255))]

Jim

______________________________________________
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.

Reply via email to