我有一个名为“rainfall”的数据集,前几行是
Year Month Date cuftsec lsec log10lsec
1 1997 January 1/15/1997 57.100 3.360907e-02 -1.473544
2 1997 February 2/15/1997 13.800 8.122686e-03 -2.090300
3 1997 March 3/15/1997 5.100 3.001866e-03 -2.522609
4 1997 April 4/15/1997 2.210 1.300812e-03 -2.885786
5 1997 May 5/15/1997 0.469 2.760590e-04 -3.558998
6 1997 June 6/15/1997 0.000 5.886000e-09 -8.230180
我想得到一个日期和 log10lsec 的线图。当我尝试
with(rainfall, plot(x = Date, y = log10lsec, type = "l"))
我得到一个带有点的图(好像 type = "l" 不存在)。
如果我设置另一个情节然后添加一条线,例如
with(rainfall, plot(x = Date, y = log10lsec))
with(rainfall, lines(x = Date, y = log10lsec))
我得到一个荒谬的线图,它以看似随机的顺序连接点。
dput(head(rainfall)) 产生:
structure(list(Year = c(1997L, 1997L, 1997L, 1997L, 1997L, 1997L
), Month = structure(c(5L, 4L, 8L, 1L, 9L, 7L), .Label = c("April",
"August", "December", "February", "January", "July", "June",
"March", "May", "November", "October", "September"), class = "factor"),
Date = structure(c(1L, 49L, 61L, 73L, 85L, 97L), .Label = c("1/15/1997",
"1/15/1998", "1/15/1999", "1/15/2000", "1/15/2001", "1/15/2002",
"1/15/2003", "1/15/2004", "1/15/2005", "1/15/2006", "1/15/2007",
"1/15/2008", "10/15/1997", "10/15/1998", "10/15/1999", "10/15/2000",
"10/15/2001", "10/15/2002", "10/15/2003", "10/15/2004", "10/15/2005",
"10/15/2006", "10/15/2007", "10/15/2008", "11/15/1997", "11/15/1998",
"11/15/1999", "11/15/2000", "11/15/2001", "11/15/2002", "11/15/2003",
"11/15/2004", "11/15/2005", "11/15/2006", "11/15/2007", "11/15/2008",
"12/15/1997", "12/15/1998", "12/15/1999", "12/15/2000", "12/15/2001",
"12/15/2002", "12/15/2003", "12/15/2004", "12/15/2005", "12/15/2006",
"12/15/2007", "12/15/2008", "2/15/1997", "2/15/1998", "2/15/1999",
"2/15/2000", "2/15/2001", "2/15/2002", "2/15/2003", "2/15/2004",
"2/15/2005", "2/15/2006", "2/15/2007", "2/15/2008", "3/15/1997",
"3/15/1998", "3/15/1999", "3/15/2000", "3/15/2001", "3/15/2002",
"3/15/2003", "3/15/2004", "3/15/2005", "3/15/2006", "3/15/2007",
"3/15/2008", "4/15/1997", "4/15/1998", "4/15/1999", "4/15/2000",
"4/15/2001", "4/15/2002", "4/15/2003", "4/15/2004", "4/15/2005",
"4/15/2006", "4/15/2007", "4/15/2008", "5/15/1997", "5/15/1998",
"5/15/1999", "5/15/2000", "5/15/2001", "5/15/2002", "5/15/2003",
"5/15/2004", "5/15/2005", "5/15/2006", "5/15/2007", "5/15/2008",
"6/15/1997", "6/15/1998", "6/15/1999", "6/15/2000", "6/15/2001",
"6/15/2002", "6/15/2003", "6/15/2004", "6/15/2005", "6/15/2006",
"6/15/2007", "6/15/2008", "7/15/1997", "7/15/1998", "7/15/1999",
"7/15/2000", "7/15/2001", "7/15/2002", "7/15/2003", "7/15/2004",
"7/15/2005", "7/15/2006", "7/15/2007", "7/15/2008", "8/15/1997",
"8/15/1998", "8/15/1999", "8/15/2000", "8/15/2001", "8/15/2002",
"8/15/2003", "8/15/2004", "8/15/2005", "8/15/2006", "8/15/2007",
"8/15/2008", "9/15/1997", "9/15/1998", "9/15/1999", "9/15/2000",
"9/15/2001", "9/15/2002", "9/15/2003", "9/15/2004", "9/15/2005",
"9/15/2006", "9/15/2007", "9/15/2008"), class = "factor"),
cuftsec = c(57.1, 13.8, 5.1, 2.21, 0.469, 0), lsec = c(0.033609066,
0.008122686, 0.003001866, 0.001300812, 0.000276059, 5.886e-09
), log10lsec = c(-1.473543558, -2.090300341, -2.522608715,
-2.885785503, -3.55899764, -8.230179742)), .Names = c("Year",
"Month", "Date", "cuftsec", "lsec", "log10lsec"), row.names = c(NA,
6L), class = "data.frame")
TIA