ruipbarradas
2018-Jun-23 17:11 UTC
[R] Deleting a specific value in a column of a data frame
Hello, Also possible is is.na (B) <- B >= A Hope this helps, Rui Barradas? Enviado a partir do meu smartphone Samsung Galaxy.-------- Mensagem original --------De: Bert Gunter <bgunter.4567 at gmail.com> Data: 23/06/2018 15:26 (GMT+00:00) Para: javad bayat <j.bayat194 at gmail.com> Cc: R-help <R-help at r-project.org> Assunto: Re: [R] Deleting a specific value in a column of a data frame You understand, of course, that all columns in a data frame must be of the same length; and that "NA" is not the same as NA? This is pretty basic stuff and suggests you need to spend some time with an R tutorial or two. In any case, a construct of the form: B[B >= A] <- NA should do. Cheers, Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jun 23, 2018 at 4:09 AM, javad bayat <j.bayat194 at gmail.com> wrote:> Dear R users; > I have two columns data frame (column names is A and B). I want to write a > function in order to compare column of B with A and if the values of B are > equal or greater than that of A, replace them with "NA" or delete them and > if the values of B are less than values in A, do nothing. > > Sincerely. > > -- > Best Regards > Javad Bayat > M.Sc. Environment Engineering > Alternative Mail: bayat194 at yahoo.com > >???????? [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >[[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see 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. [[alternative HTML version deleted]]