Displaying 2 results from an estimated 2 matches for "spp4".
Did you mean:
spp
2010 Jan 13
3
counting the number of times a string appears
Hi all,
I have a vector of strings and need to count the number of times a string
appears in the vector.
eg:
[1] spp6 spp10 spp6 spp6 spp4 spp2 spp9 spp10 spp5 spp2 spp2 spp3
[13] spp4 spp3 spp6 spp10 spp6 spp4 spp9 spp3 spp6 spp1 spp10 spp8
[25] spp2 spp10 spp9 spp7 spp1 spp3 spp8 spp6 spp3 spp8 spp6 spp5
[37] spp5 spp9 spp3 spp1 spp4 spp5 spp9 spp3 spp3 spp5 spp4 spp9
[49] spp3 spp7 spp7...
2005 Aug 16
2
problem using model.frame()
...sep = "")
colnames(y1) <- paste("spp", 1:4, sep = "")
y1
model.frame(~ y1)
Error in model.frame(formula, rownames, variables, varnames, extras, extranames, :
invalid variable type
temp <- as.matrix(y1)
model.frame(~ temp)
temp.spp1 temp.spp2 temp.spp3 temp.spp4
1 3 1 0 1
2 0 1 1 0
3 0 0 1 0
4 0 0 1 1
5 0 1 1 1
Ideally the above wouldn't have names like temp.var1, temp.var2, but one
could deal...