R 具有特定属性的日期直方图

R 具有特定属性的日期直方图,r,statistics,R,Statistics,我有一些数据: > (dput(head(data$Date,10))) c("18.12.2003", "06.04.2005", "06.04.2005", "07.04.2005", "27.05.2005", "16.06.2009", "16.06.2009", "21.12.2009", "22.12.2009", "09.06.2011" ) [1] "18.12.2003" "06.04.2005" "06.04.2005" "07.04.2005" "27.05.20

我有一些数据:

> (dput(head(data$Date,10)))
c("18.12.2003", "06.04.2005", "06.04.2005", "07.04.2005", "27.05.2005", 
"16.06.2009", "16.06.2009", "21.12.2009", "22.12.2009", "09.06.2011"
)
 [1] "18.12.2003" "06.04.2005" "06.04.2005" "07.04.2005" "27.05.2005"
 [6] "16.06.2009" "16.06.2009" "21.12.2009" "22.12.2009" "09.06.2011"
> (dput(head(data$Art,10)))
c("V", "K", "K", "K", "Zuteilung", "V", "K", "K", "K", "V")
 [1] "V"         "K"         "K"         "K"         "Zuteilung" "V"        
 [7] "K"         "K"         "K"         "V"        
正如您可以看到的,每个日期都有一个字符串值

我可以使用以下工具测量
K
的所有字符串值:

> (length(grep("K", data$Art)))
我想在同一日期绘制K的所有频率

有了这个,我可以绘制所有的日期,但是这不包括
K
字符串

hist(as.Art(data$Date, '%d.%m.%Y'), breaks="days", freq=TRUE)
我真的很感激你的回答