[R] Biplot connecting consecutive dates (ggplot?)

stephen sefick ssefick at gmail.com
Fri Oct 10 00:04:44 CEST 2008


I would like to connect the dots based on when they occur in time.  Is
there an easy way to do this?
thanks

f <- (structure(list(date = structure(c(1L, 2L, 3L, 10L, 11L, 12L,
13L, 14L, 15L, 16L, 17L, 18L, 19L, 4L, 5L, 6L, 7L, 8L, 9L, 2L,
3L, 10L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 4L, 5L, 6L, 7L, 9L
), .Label = c("1/1/03", "1/1/04", "1/1/06", "10/1/02", "10/1/05",
"11/1/02", "12/1/01", "12/1/02", "12/1/04", "2/1/03", "3/3/03",
"4/1/03", "5/1/02", "5/1/03", "7/1/02", "7/1/04", "8/1/03", "8/1/04",
"8/1/05"), class = "factor"), site = structure(c(1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("dn",
"up"), class = "factor"), V1 = c(-0.7066502, 0.07847893, 0.258610632,
-0.856286332, -0.839723411, -0.427242353, 0.188298251, -0.372911996,
0.042951816, 0.687447841, 0.326707494, 0.516105863, 0.727867663,
-0.072490327, 0.432699191, -0.691885485, -0.351714766, -0.816169763,
0.267076547, 0.282199633, 0.313147496, -0.448375673, 0.343732471,
-0.241244084, 0.049120729, 0.57733722, 0.1557785, 0.581664579,
0.596399267, -0.147121306, 0.386559808, -0.424068871, -0.467088965,
0.050789598), V2 = c(0.286015324, -0.308010116, -0.19965154,
0.366323539, 0.426800995, -0.735712725, -0.824072121, -0.767824938,
-0.149185618, 0.458001784, -0.440086289, 0.592207506, -0.007212198,
0.153280492, -0.046479998, 0.01649528, 0.256636068, 0.409410528,
0.449511677, -0.206785849, -0.099980263, -0.024985078, -0.601906929,
-0.606890646, -0.044453941, 0.514850946, -0.247136552, 0.649317152,
0.015122002, 0.040152681, -0.015410245, 0.263439166, 0.030986594,
0.397233313)), .Names = c("date", "site", "V1", "V2"), class =
"data.frame", row.names = c(NA,
-34L)))

library(ggplot2)
qplot(V1, V2, data=f, colour=date)

--
Stephen Sefick
Research Scientist
Southeastern Natural Sciences Academy

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis



More information about the R-help mailing list