Serguei Kaniovski <[EMAIL PROTECTED]> writes: > Hi all, > > how can I divide two tables of the same dimension so that all names are > preserved, ie do not become NA? I have "tab1" and "tab2", each having > names in the first column. I want "tab3" with the same names and values > "tab1/tab2".
Explain. If tab1 and tab2 have names "in the first column", how do you expect the divide operation to work? Tables normally do preserve row/column names in arithmetic: > t1 <- t2 <- table(airquality$Month,airquality$Temp> 80) > t1 FALSE TRUE 5 30 1 6 20 10 7 3 28 8 11 20 9 21 9 > t1/t2 FALSE TRUE 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 -- O__ ---- Peter Dalgaard Ă˜ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - ([EMAIL PROTECTED]) FAX: (+45) 35327907 ______________________________________________ R-help@stat.math.ethz.ch 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.