# # Epage 37 # # Written by: # -- # John L. Weatherwax 2009-04-21 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- library(DAAG) str(rainforest) rainforest$isBranchNA = is.na( rainforest$branch ) tbl = table( rainforest$species, rainforest$isBranchNA ) df = as.data.frame.matrix( tbl ) colnames(df) = c("Valid Data","NA Data") df$"Total Samples" = df$"Valid Data" + df$"NA Data" print(df)