On Wed, 02 Aug 2006 17:12:53 -0400, Chuck Cleland wrote:
> Why not do it this way?
> 
> Df$bat <- replace(Df$bat, Df$bat >=50, 100)

Is that any different, performancewise, than the following?

Df$bat[Df$bat >= 50] <- 100

Gerald Jansen


...
John Kane wrote:
> Simple example
> 
> cat <- c( 3,5,6,8,0)
> dog <- c(3,5,3,6, 0)
> rat <- c (5, 5, 4, 9, 0)
> bat <- c( 12, 42, 45, 32, 54)
> 
> Df <- data.frame(cbind(cat, dog, rat, bat))
...

______________________________________________
[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.

Reply via email to