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 Data: 23/06/2018 15:26
(GMT+00:00) Para: javad bayat Cc: R-help
Assunto: Re: [R] Deleting a specific va
arlson
Department of Anthropology
Texas A&M University
-Original Message-
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Bert Gunter
Sent: Saturday, June 23, 2018 9:27 AM
To: javad bayat
Cc: R-help
Subject: Re: [R] Deleting a specific value in a column of a data frame
Y
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,
B
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.
S
4 matches
Mail list logo