Displaying 4 results from an estimated 4 matches for "spp1".
Did you mean:
sp1
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]...
2005 Aug 16
4
as.character and a formula
Dear list,
given this formula:
> fmla <- formula(y1 ~ spp1 + spp2 + spp3 + spp5)
> fmla[[3]]
spp1 + spp2 + spp3 + spp5
is this the intended behaviour of as.character:
> as.character(fmla[[3]])
[1] "+" "spp1 + spp2 + spp3" "spp5"
? Where does the extra "+" come from?
> as.character(fmla)...
2004 Mar 10
3
Center labels on a boxplot
...'boxplot.'
Since the boxes are paired by species, I want to do is have the x labels
be centered between the boxes. I'm doing this now with mtext and
entering spaces to make them center. There must be a better way.
Much thanks, Andy
#######################
myDF1 <- data.frame(spp1 = c(0,0,0,0,1,0,1,1,0,0,0,1),
spp2 = c(1,0,1,1,0,0,0,0,1,0,0,0),
spp3 = c(0,1,0,0,0,1,0,0,0,1,1,0),
aVar = runif(12, 1, 10) + 1:12)
myDF2 <- data.frame(spp1 = c(1,1,0,0,0,0,0,0,1,0,0,1),
spp2 =...
2005 Aug 16
2
problem using model.frame()
...paste("site", 1:5, 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,...