sorry for the ugly code, but I'm not sure exactly what's going wrong
for (i in 1:1)
tab_sector[1:48,i] <-
tapply(get(paste("employee",1997-1+i, "[birth<=(1997-1+i)]",sep="")),
ordered(sic2digit[birth<=(1997-1+i)],levels=tab_sector_list))
# Error in get(paste("employee", 1997 - 1 + i,
# "[birth<=(1997-1+i))]", : object 'employee97[birth<=(1997-1+i)]' not found
but the variable is there:
head(employee97[birth<=(1997-1+i)])
# [1] 1 2 2 1 3 4
a simpler version where "employee" is not conditioned by "birth" works
paste("employee",1997-1+i, "[birth<=(1997-1+i)]",sep="")give youemployee1997[birth<=(1997-1+i)]rather thanemployee97[...? either the code snippet or the error reported by R doesn't match!