Displaying 4 results from an estimated 4 matches for "elevcat".
2012 Apr 05
2
count() function
...pecting R to have something analogous to the =count function in
Excel, but I can't find anything. I simply want to count the data for a
given category.
I've been using the ddply() function in the plyr package to summarize
means and st dev of my data, with this code:
ddply(NZ_Conifers,.(ElevCat, DataSource, SizeClass), summarise,
avgDensity=mean(Density), sdDensity=sd(Density), n=sum(Density))
and that gives me results that look like this:
ElevCat DataSource SizeClass avgDensity sdDensity n
1 Elev1 FIA Class1 38.67768 46.6673478 734.87598
2 Elev1...
2011 Feb 08
1
Grouping by factors in R
I'm having a hard time figuring out how to group results by certain
factors in R. I have data with the following headings:
[1] "Time" "Plot" "LatCat" "Elevation" "ElevCat"
"Aspect" "AspCat" "Slope"
[9] "SlopeCat" "Species" "SizeClass" "Stems"
and I'm trying to use a GLM to test differences in "Stems" for different
categories/factors - most importantly, I want to gr...
2012 Aug 07
5
summing and combining rows
...ng a new class, that would be preferable.
I've also attached a more detailed sample of data.
Thanks,
Chris Dolanc
--
Christopher R. Dolanc
Post-doctoral Researcher
University of Montana and UC-Davis
-------------- next part --------------
Data Plot Lat LatCat Elevation ElevCat Type SizeClass Stems Area Density
5171 VTM 39C16 39.76282 Lat6 1500 Elev1 Conifer Class3 0 751.5347 0.00000
5172 VTM 39C16 39.76282 Lat6 1500 Elev1 Conifer Class4 1 751.5347 13.30611
5771 VTM 39F11 39.57721 Lat6 50...
2012 Mar 25
2
avoiding for loops
I have data that looks like this:
> df1
group id
1 red A
2 red B
3 red C
4 blue D
5 blue E
6 blue F
I want a list of the groups containing vectors with the ids. I am
avoiding subset(), as it is
only recommended for interactive use. Here's what I have so far:
df1 <- data.frame(group=c("red", "red", "red", "blue",