On 4/3/2013 4:33 AM, Naser Jamil wrote: > Dear R-user, > May I seek your suggestion. I have a data file 'stop' to be scanned in R. > But I want to ignore one specific number '21' there. Putting differently, I > want to get all numbers in the file except 21. Is there any command to > achieve it? > > -------------------------------------------------------------- > > b<-scan("F:\\stop.txt") > > -------------------------------------------------------------- Well, I don't know what is in stop.txt, but I will assume it is a string of numbers or strings separated by the end of line character and then a terminating EOL. Read it in as you have it and then: b <- b[-21]
If you are reading in a dataframe, simply use what you have and then do: b <- b[-21, ] and you should have what you want, or perhaps you want b[21, ] <- NA # indicate row 21 as a missing value > Many thanks for your kind attention. > > Regards, > Jamil. > > > ______________________________________________ > 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. -- Robert W. Baer, Ph.D. Professor of Physiology Kirksille College of Osteopathic Medicine A. T. Still University of Health Sciences Kirksville, MO 63501 USA [[alternative HTML version deleted]] ______________________________________________ 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.