지금 당분간이 문제를보고 있습니다.이 ggplot 구문에 문제가있는 사람이 있습니까?ggplot에 그래프가 나타나지 않음
Error: Discrete value supplied to continuous scale
이 Z입니다 :이 오류를 얻고있다
Month Value
1 2011-01-01 11
2 2011-02-01 5
3 2011-03-01 6
4 2011-04-01 6
5 2011-05-01 4
6 2011-06-01 5
7 2011-07-01 3
8 2011-08-01 9
9 2011-09-01 19
10 2011-10-01 3
11 2011-11-01 6
12 2011-12-01 2
13 2012-01-01 1
14 2012-02-01 4
15 2012-04-01 1
16 2012-05-01 2
17 2012-06-01 11
18 2012-07-01 5
ggplot(z, aes(Month, Value)) +
geom_bar(fill="orange",size=.3) +
theme_bw() + scale_x_discrete(name="Date") +
scale_y_continuous("Number") +
opts(title="Monthly issues",
axis.title.x = theme_text(face="bold", colour="#990000"),
axis.text.x = theme_text(angle=90),
axis.title.y = theme_text(face="bold", colour="#990000", angle=90)
) +
geom_smooth(data=z,aes(Month,Value,group=1), method="lm", size=2, color="darkblue")
나를 위해 잘 실행하고 잘 음모를 생산하고 있습니다. 'str (z)'를 체크하고 인자로 값이 저장되어 있지 않은지 확인하십시오. – joran
이것은 str (z)의 출력입니다. str (z) 'data.frame': 18 obs. 2 변수 : $ 월 : 날짜, 형식 : "2011-01-01" "2011-02-01" "2011-03-01" "2011-04-01"... $ 값 : 숫자 11 5 6 6 4 5 3 9 19 3 ... –