Skip to content

Scatter plot from tapply output, labels of data

2 messages · monaR, Jean V Adams

#
Hei,
i am trying to plot the means of two variables (d13C and d15N), by 2
grouping factors (Species and Year) that i obtained by the function tapply.
I would like to plot with different colours according to the Year and show
the "Species" as data labels.
My data looks like this:

Species          d13C    d13N    Year
"Species1"    14,4       11.5     2009
"Species2"       ...            ...       ....
##works fine, returns something like this

          Species1         Species2         Species3
2009 20.3                  13.4                 13,5
2011 NA                     23.5                 14.5
2012 11.3                   NA                    23.4
#works fine, gives a plot with data points coloured by "Year"
#does not work, mixes up the labels, have tried Species<-as.factor(Species)
and switched tapply(d15N,list(Year,Species),mean)
to-->tapply(d15N,list(Species,Year),mean) which gives the Years as column
names but does not produce a better plot. The

I cannot find the error, any idea what i am doing wrong????
Thanks sooo much



--
View this message in context: http://r.789695.n4.nabble.com/Scatter-plot-from-tapply-output-labels-of-data-tp4642077.html
Sent from the R help mailing list archive at Nabble.com.