Try this also: pmax(test - 1, 1)
On Tue, May 18, 2010 at 8:34 AM, Knut Krueger <[email protected]> wrote: > > Hi to all, > I am just looking for more efficient ways ;-) > > is there a better way instead a loop to decrease x if greater y > test <- c(1,3,5,7,9) > > decrease if greater 1 to > test2 <- c(1,2,4,6,8) > > > Kind regards > Knut > > ______________________________________________ > [email protected] 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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]]
______________________________________________ [email protected] 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.

