私は迷子をはるかに超えているので、ここで本当に助けが必要です。
1 年間の複数のチームのパフォーマンスを示す折れ線グラフを作成しようとしています。私は 1 年を 2012 年 1 月 1 日、2012 年 4 月 1 日のように四分の一に分けました。12/8/1。2012 年 12 月 1 日、csv データ フレームを R にロードしました。
Month Team Position
1 1/1/12 South Africa 56
2 1/1/12 Angola 85
3 1/1/12 Morocco 61
4 1/1/12 Cape Verde Islands 58
5 4/1/12 South Africa 71
6 4/1/12 Angola 78
7 4/1/12 Morocco 62
8 4/1/12 Cape Verde Islands 76
9 8/1/12 South Africa 67
10 8/1/12 Angola 85
11 8/1/12 Morocco 68
12 8/1/12 Cape Verde Islands 78
13 12/1/12 South Africa 87
14 12/1/12 Angola 84
15 12/1/12 Morocco 72
16 12/1/12 Cape Verde Islands 69
ggplot2 を使用してグラフを生成しようとすると、12/12 の第 4 四半期が不可解に 2 番目の場所に移動します。
ggplot(groupA, aes(x=Month, y=Position, colour=Team, group=Team)) + geom_line()
次に、scale_x を使用して日付をフォーマットするために、このプロットを変数 GA に入れます。
GA + scale_x_date(labels = date_format("%m/%d"))
しかし、私はこのエラーを受け取り続けます:
Error in structure(list(call = match.call(), aesthetics = aesthetics, :
関数「date_format」が見つかりませんでした
そして、このコードを実行すると:
GA + scale_x_date()
次のエラーが表示されます。
Error: Invalid input: date_trans works with objects of class Date only
R 2.15.2 を実行している Mac OS X を使用しています
助けてください。