[R] Merge and replace data

roslinazairimah zakaria ro@||n@ump @end|ng |rom gm@||@com
Tue Sep 5 12:52:53 CEST 2023


Thank you very much for your help.

On Tue, Sep 5, 2023 at 6:12 PM Eric Berger <ericjberger using gmail.com> wrote:

> xx <- pmax(x1,x2)
>
> On Tue, Sep 5, 2023 at 11:56 AM roslinazairimah zakaria
> <roslinaump using gmail.com> wrote:
> >
> > Hi all,
> >
> > I have these data
> >
> > x1 <- c(116,0,115,137,127,0,0)
> > x2 <- c(0,159,0,0,0,159,127)
> >
> > I want : xx <- c(116,115,137,127,159, 127)
> >
> > I would like to merge these data into one column. Whenever the data is
> '0'
> > it will be replaced by the value in the column which is non zero..
> > I tried append and merge but fail to get what I want.
> >
> > --
> > *Roslina Zakaria*
> >
> >         [[alternative HTML version deleted]]
> >
> > ______________________________________________
> > R-help using 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.
>


-- 
*Roslinazairimah Zakaria*
*Tel: +609-5492370; Fax. No.+609-5492766*

*Email: roslinazairimah using ump.edu.my <roslinazairimah using ump.edu.my>;
roslinaump using gmail.com <roslinaump using gmail.com>*
Faculty of Industrial Sciences & Technology
University Malaysia Pahang
Lebuhraya Tun Razak, 26300 Gambang, Pahang, Malaysia

	[[alternative HTML version deleted]]



More information about the R-help mailing list