Hey Brett,
I don't know what the internals of your 'dates' and 'd1' data structures are, but here's some code that might help. If you're storing your date values as a proper date class, R will represent them internally by the number of days since some origin (which might be platform-specific). So to get your arrows in the correct location, you just need to convert your human-readable date into the number of days since that origin. I'm keeping it simple below by just referencing the date objects I've already created.
###############
Lines <- "Date Weight
1/10/2012 69
2/10/2012 71
3/10/2012 79
4/10/2012 80
5/10/2012 70
6/10/2012 53
7/10/2012 69
8/10/2012 75
9/10/2012 71
10/10/2012 70
11/10/2012 82
12/10/2012 64"
reader <- textConnection(Lines)
df <- read.table(reader, header = TRUE)
close(reader)
df$Date <- as.Date(df$Date, "%d/%m/%Y")
plot(df, xaxt = "n", type = "l", frame=FALSE, main="Big", col="blue", ylab="Proportion Weight Increase/Decrease", cex=1.1, cex.axis=1.5, cex.lab=1.5)
axis(1, df$Date, format(df$Date, "%b %d"), cex.axis = .7)
arrows(df$Date[2], df$Weight[2] - 0.2, df$Date[2], df$Weight[2] - 5, code=1, col="red")
arrows(df$Date[8], df$Weight[8] + 0.2, df$Date[8], df$Weight[8] + 5, code=1, col="red")
###############
Let me know if this does and/or doesn't make sense.
Stewart
On 16/10/2012, at 1:06 PM, Brett Scheffers <
sche...@gmail.com>
wrote:
> --
> An R group for questions, tips and tricks relevant to spatial ecology and climate change.
> All R questions welcome.
> ---
> You received this message because you are subscribed to the Google Groups "Tropical R" group.
> To post to this group, send an email to
tropi...@googlegroups.com.
> To unsubscribe from this group, send email to
tropical-r+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>