Another option could be:

data$z <- as.numeric(gsub("(^\\d{4}).*", "\\1", gsub("^$", "2009",
data$ukrok))) - data$rocnik


On Sun, May 2, 2010 at 8:25 AM, peterko <lanikpeter@gmail.com> wrote:

>
> Thank you Jim, it works very well. I do not need do it using tapply, but i
> think that it is the way.
>
> And Patrick thank you too
> --
> View this message in context:
> http://r.789695.n4.nabble.com/help-with-tapply-or-other-apply-tp2122683p2122728.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help@r-project.org 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]]

