Displaying 2 results from an estimated 2 matches for "densplants".
2006 Sep 20
4
Calculating mean together with split
Hi
I have a table called npl containing results of simulations.
It contains about 19000 entries and the structure looks like this:
NoPlants sim run year DensPlants
1 6 lng_cs99_renosterbos 1 4 0.00192
.
.
.
it has 43 different entries for sim and year goes from 1 to 100, and run
from 1 to 5.
I would like to calculate the mean of DensPlants for each simulation and
each year seperately, i.e. calculating the mean for all combinations of
sim...
2006 Sep 21
1
transforming factor back to numbers
Hi
I generate a new dataframe by doing:
npl.agg <- aggregate(npl$DensPlants, list(year=npl$year, sim=npl$sim),
mean, na.rm=TRUE )
Now I want to plot it by using
coplot(npl.agg$x ~ npl.agg$year | npl.agg$sim, type="l")
but, as npl.agg$year is seen as a factor, the order of the points on the
x-axis (time axis) does not follow the numerical sorting 1...100, but...