search for: aadams26

Displaying 2 results from an estimated 2 matches for "aadams26".

2012 Jul 11
3
Subset based on multiple values
I'm stuck on a seemingly simple problem. I'm trying to subset the data by several numbers and it cuts out half of the rows. Here is the sample code: test <- as.matrix(c(1,1,1,1,3,3,7,7,7,7)) Count <- tapply(test[,1], test[,1], length) # count for each value spp <- unique(test[,1]) Count1 <- as.data.frame(cbind(Count,spp)) Max <- max(Count) Count1$sppMax <-
2012 Jul 06
4
convert a table
I have my data in a table table <- table(test2$Filename, test2$PREDICT) I need to convert this table so it keeps the same structure, but is a different format. The current output is count data by Filename and I want to get the max for each Filename. Columns are: Filename, 1, 2, 3, 4, 5, 6, 7 When I try to convert it to a data.frame it reverts to Var1(Filename), Var2(1:7), Freq. My end goal