Ulziibat Tserenbat
mtcars$gear <- factor(mtcars$gear,levels=c(3,4,5),
labels=c("3gears","4gears","5gears"))
mtcars$am <- factor(mtcars$am,levels=c(0,1),
labels=c("Automatic","Manual"))
mtcars$cyl <- factor(mtcars$cyl,levels=c(4,6,8),
labels=c("4cyl","6cyl","8cyl"))
qplot(carb, mpg, data=mtcars, shape=am,
color=am, facets=gear~cyl, size=I(3),
xlab="Carb", ylab="Miles per
Gallon")
qplot(wt, mpg, data=mtcars, geom=c("point",
"smooth"), color=cyl,
main="Smoothers of MPG on Weight",
xlab="Weight", ylab="Miles per Gallon")
mydata <- Quandl("FRED/INDPRO")
mydata
plot(mydata)
mydata <- Quandl("FRED/INDPRO", start_date="2009-12-31", end_date="2012-12-31")
plot(mydata)
mydata <- Quandl("FRED/INDPRO", collapse = "quarterly")
plot(mydata)
mydata <- Quandl("FRED/INDPRO", type="ts")
mydata
Jan Feb Mar Apr May Jun
1919 5.0124 4.7908 4.6523 4.7354 4.7631 5.0677
1920 5.7877 5.7877 5.6770 5.3724 5.5108 5.5662
1921 4.0985 4.0154 3.9046 3.9046 4.0154 3.9877
1922 4.4585 4.6524 4.9016 4.7354 4.9847 5.2339
1923 5.9816 6.0647 6.2585 6.3970 6.4801 6.4247
1924 6.0924 6.2031 6.0924 5.8985 5.6493 5.4000
1925 6.3139 6.3139 6.3139 6.3693 6.3416 6.2862
1926 6.6185 6.6185 6.7016 6.7016 6.6462 6.7293
1927 6.8677 6.9231 7.0062 6.8401 6.8954 6.8678
1928 6.7016 6.7570 6.8124 6.7847 6.8678 6.9231
1929 7.7262 7.6985 7.7262 7.8647 8.0032 8.0585
1930 7.1724 7.1447 7.0339 6.9785 6.8678 6.6739
1931 5.6493 5.6770 5.7877 5.8154 5.7324 5.5939
1932 4.6523 4.5416 4.4862 4.1816 4.0431 3.9047
1933 4.1262 4.1539 3.9046 4.1816 4.8739 5.6216
1934 5.1785 5.4277 5.6770 5.6770 5.7877 5.6770
1935 5.9816 6.0924 6.0647 5.9539 5.9539 6.0370
1936 6.7293 6.5631 6.6462 7.0616 7.2001 7.3385
1937 8.2801 8.3908 8.5847 8.5847 8.6124 8.5016
1938 6.1201 6.0647 6.0647 5.9539 5.8154 5.8708
1939 7.2554 7.3108 7.3385 7.3108 7.2831 7.4493
1940 8.7785 8.5016 8.3078 8.4739 8.7232 9.0001
1941 10.3016 10.6062 10.9386 10.9662 11.4647 11.5478
1942 12.4340 12.6555 12.7940 12.4340 12.4616 12.4893
1943 14.7325 15.1201 15.2309 15.4247 15.5355 15.4524
1944 17.1140 17.2525 17.2248 17.2248 17.1140 17.0586
1945 16.8371 16.7817 16.6709 16.3663 15.9232 15.5632
1946 11.7139 11.1324 12.2955 12.0740 11.6309 12.3509
1947 14.0678 14.1509 14.2340 14.1232 14.1786 14.1786
1948 14.7601 14.7878 14.6217 14.6494 14.8986 15.0924
1949 14.5663 14.4278 14.1509 14.0678 13.8740 13.8463
1950 14.4278 14.4832 14.9540 15.4524 15.8124 16.2832
1951 17.6678 17.7786 17.8617 17.8894 17.8340 17.7509
1952 17.8340 17.9448 18.0002 17.8340 17.6678 17.5017
1953 19.7448 19.8556 20.0217 20.1048 20.2156 20.1325
1954 18.6094 18.6648 18.5540 18.4432 18.5540 18.6094
1955 19.8556 20.1048 20.5756 20.8248 21.1571 21.1848
1956 22.0987 21.9048 21.9048 22.0710 21.8771 21.6833
1957 22.6248 22.8464 22.8187 22.5141 22.4310 22.4864
1958 20.7694 20.3263 20.0771 19.7448 19.9386 20.4648
1959 22.6248 23.0679 23.4002 23.8987 24.2587 24.2864
1960 24.8956 24.6741 24.4525 24.2587 24.2310 23.9264
1961 22.7910 22.7633 22.9018 23.3725 23.7325 24.0648
1962 25.3941 25.8095 25.9479 26.0033 25.9756 25.9202
1963 26.6956 27.0003 27.1664 27.4156 27.7480 27.8310
1964 28.5787 28.7726 28.7726 29.2434 29.4095 29.4926
1965 31.1818 31.3757 31.7911 31.9295 32.1788 32.4280
1966 34.1726 34.3942 34.8649 34.9203 35.2526 35.4188
1967 36.2258 35.8149 35.6130 35.9489 35.6353 35.6308
1968 37.3462 37.4801 37.5970 37.6515 38.0738 38.2137
1969 39.3402 39.5919 39.9024 39.7555 39.6053 39.9922
1970 39.0743 39.0485 38.9978 38.8975 38.8522 38.7265
1971 38.6429 38.5692 38.5274 38.7438 38.9404 39.1037
1972 41.2866 41.6800 41.9758 42.4207 42.3956 42.5178
1973 45.2914 45.9647 45.9868 45.9274 46.2184 46.2516
1974 46.9002 46.7547 46.7680 46.6012 46.9779 46.9246
1975 42.6437 41.6572 41.2130 41.2483 41.1540 41.4216
1976 44.2338 44.6687 44.7103 44.9525 45.1731 45.1831
1977 46.8261 47.5387 48.1302 48.5780 48.9881 49.3428
1978 49.2047 49.4519 50.3920 51.4438 51.6239 51.9809
1979 53.0435 53.3331 53.4972 52.8947 53.3176 53.3158
1980 53.5021 53.5079 53.3284 52.2375 50.9676 50.3335
1981 52.4688 52.2219 52.5009 52.2665 52.5783 52.8272
1982 50.3077 51.2996 50.9105 50.4590 50.1366 49.9690
1983 49.1748 48.8671 49.2655 49.8681 50.2070 50.5080
1984 54.5975 54.8377 55.1047 55.4593 55.7123 55.9079
1985 56.1365 56.3356 56.4232 56.2716 56.3525 56.3903
1986 57.3112 56.9304 56.5414 56.5654 56.6850 56.4959
1987 57.6873 58.4361 58.5202 58.8852 59.2656 59.5423
1988 62.1393 62.4100 62.5464 62.8992 62.8182 62.9776
1989 64.0114 63.7241 63.8694 63.9217 63.4806 63.5122
1990 63.4171 64.0517 64.3607 64.2562 64.3971 64.6064
1991 62.8801 62.4520 62.1200 62.2500 62.8714 63.4441
1992 63.3372 63.7864 64.3199 64.8069 65.0202 65.0309
1993 66.5650 66.8562 66.7661 66.9976 66.7645 66.8782
1994 68.7602 68.7808 69.4762 69.8715 70.2259 70.6759
1995 73.4173 73.3112 73.4086 73.3603 73.6079 73.8595
1996 74.6833 75.8433 75.7631 76.4596 77.0169 77.6676
1997 79.8239 80.7816 81.3388 81.3611 81.8326 82.2309
1998 86.6558 86.7556 86.8196 87.1345 87.6936 87.1421
1999 89.8617 90.3253 90.4709 90.7285 91.3499 91.1990
2000 94.1717 94.4329 94.7926 95.4898 95.6421 95.7364
2001 94.5502 93.9755 93.7253 93.4567 92.8842 92.3317
Jul Aug Sep Oct Nov Dec
1919 5.3724 5.4554 5.3447 5.2893 5.2062 5.2893
1920 5.4277 5.4554 5.2616 5.0400 4.6247 4.3477
1921 3.9600 4.0985 4.1262 4.3754 4.3200 4.2923
1922 5.2339 5.1231 5.4000 5.7047 5.9539 6.1201
1923 6.3693 6.2585 6.1201 6.0924 6.0924 5.9539
1924 5.3170 5.5108 5.7047 5.8431 5.9539 6.1201
1925 6.4524 6.3416 6.2585 6.5077 6.6462 6.7293
1926 6.7570 6.8401 6.9508 6.9508 6.9231 6.8954
1927 6.7847 6.7847 6.6739 6.5354 6.5354 6.5631
1928 7.0062 7.1447 7.2001 7.3385 7.4770 7.6155
1929 8.1693 8.0862 8.0308 7.8924 7.5047 7.1724
1930 6.3693 6.2308 6.1201 5.9539 5.8154 5.6770
1931 5.5108 5.3170 5.0677 4.8739 4.8185 4.7908
1932 3.7939 3.9046 4.1539 4.2923 4.2923 4.2093
1933 6.1477 5.8985 5.5662 5.2893 4.9847 5.0123
1934 5.2893 5.2339 4.9293 5.1508 5.2062 5.5385
1935 6.0370 6.2585 6.4247 6.6185 6.7570 6.8401
1936 7.4770 7.5878 7.7262 7.8370 8.0585 8.3078
1937 8.5570 8.5016 8.2247 7.6155 6.8678 6.2585
1938 6.2031 6.5354 6.7293 6.8954 7.1724 7.2554
1939 7.6708 7.7816 8.2524 8.6678 8.8893 8.8893
1940 9.1108 9.1662 9.3601 9.4985 9.7201 10.0524
1941 11.6863 11.8247 11.8247 11.9355 11.9909 12.1847
1942 12.7940 13.1817 13.4863 13.9294 14.2617 14.5940
1943 15.9232 16.2555 16.6709 16.9201 17.1417 16.9201
1944 17.0309 17.2525 17.1417 17.1971 17.0586 17.0032
1945 15.2032 13.6247 12.4063 11.9078 12.3509 12.4063
1946 12.7663 13.2370 13.4863 13.7355 13.8186 13.9017
1947 14.0955 14.1786 14.2894 14.4278 14.6217 14.6771
1948 15.0924 15.0370 14.9263 15.0371 14.8432 14.7047
1949 13.8186 13.9570 14.0955 13.5694 13.9294 14.1786
1950 16.8094 17.3355 17.2248 17.3355 17.3078 17.6125
1951 17.4740 17.3078 17.4186 17.3909 17.5294 17.6402
1952 17.2248 18.3325 18.9971 19.1910 19.5786 19.6894
1953 20.3817 20.2709 19.8556 19.6894 19.2186 18.7479
1954 18.6371 18.6094 18.6371 18.8586 19.1632 19.4125
1955 21.3510 21.3233 21.4617 21.8217 21.8771 21.9602
1956 21.0186 21.8771 22.3756 22.5694 22.3756 22.7079
1957 22.6248 22.6248 22.4310 22.0987 21.5725 21.1571
1958 20.7694 21.1848 21.3787 21.6279 22.2648 22.2925
1959 23.7048 22.9017 22.8741 22.7079 22.8464 24.2587
1960 23.8433 23.8156 23.5664 23.5387 23.2064 22.7633
1961 24.3418 24.5633 24.5356 25.0064 25.3941 25.6156
1962 26.1695 26.1972 26.3633 26.3910 26.5018 26.5018
1963 27.7203 27.7756 28.0526 28.2464 28.3849 28.3295
1964 29.6864 29.8803 29.9910 29.5757 30.4895 30.8495
1965 32.7326 32.8711 32.9542 33.2865 33.4249 33.8403
1966 35.6126 35.6403 35.9726 36.2218 35.9726 36.0557
1967 35.5497 36.2308 36.1720 36.4666 36.9881 37.3865
1968 38.1551 38.2615 38.4065 38.4827 38.9805 39.1036
1969 40.2033 40.2957 40.2867 40.2985 39.9186 39.8115
1970 38.8216 38.7524 38.4852 37.7154 37.4870 38.3479
1971 38.9902 38.7639 39.3939 39.6888 39.8572 40.3174
1972 42.5004 43.0644 43.3948 43.9709 44.4866 45.0000
1973 46.4427 46.3634 46.7782 47.0944 47.3422 47.2312
1974 46.9465 46.4902 46.5124 46.3395 44.8159 43.2364
1975 41.8198 42.2548 42.7754 42.9700 43.0627 43.5959
1976 45.4519 45.7737 45.9055 45.9220 46.6016 47.0857
1977 49.4131 49.4274 49.6665 49.7589 49.8149 49.8936
1978 51.9572 52.1531 52.2862 52.7031 53.1001 53.3889
1979 53.2432 52.8891 52.9468 53.2382 53.1886 53.2612
1980 49.9417 50.1226 50.9338 51.5801 52.4731 52.7676
1981 53.1722 53.1672 52.8548 52.4951 51.8972 51.3277
1982 49.8127 49.3780 49.2276 48.7850 48.5953 48.2401
1983 51.2740 51.8458 52.6317 53.0647 53.2564 53.5313
1984 56.0852 56.1353 56.0340 55.9427 56.1631 56.2299
1985 56.0242 56.2533 56.4939 56.2610 56.4503 57.0454
1986 56.8096 56.7348 56.8483 57.1179 57.3826 57.8627
1987 59.9560 60.4517 60.6087 61.4886 61.8151 62.1113
1988 63.0040 63.2781 63.1080 63.4145 63.5171 63.8207
1989 62.9479 63.5199 63.2966 63.2481 63.4576 63.8477
1990 64.5289 64.7258 64.8148 64.3264 63.5713 63.1589
1991 63.5106 63.5623 64.1234 64.0179 63.9427 63.6923
1992 65.6155 65.2948 65.4461 65.9387 66.2219 66.2778
1993 67.0843 67.0144 67.3337 67.8513 68.1384 68.5029
1994 70.7851 71.2069 71.4768 72.0827 72.5328 73.2862
1995 73.5675 74.4969 74.7941 74.7015 74.8864 75.1739
1996 77.5653 78.0121 78.5488 78.5060 79.1955 79.7144
1997 82.8500 83.7172 84.4629 85.1968 85.9458 86.2054
1998 86.8414 88.6266 88.4562 89.1686 89.1127 89.4388
1999 91.7767 92.1675 91.7812 92.9976 93.4440 94.1555
2000 95.5982 95.3172 95.6844 95.3974 95.4158 95.1619
2001 91.8098 91.6849 91.3345 90.9389 90.4853 90.5150
[ reached getOption("max.print") -- omitted 17 rows ]
mydata <- Quandl("FRED/GDP", type="ts")
plot(mydata)
mydata <- Quandl("FRED/INDPRO", type="ts", start_date="2009-12-31", end_date="2012-12-31")
ts.plot(mydata)
data <- read.csv("http://datasets.flowingdata.com/post-data.txt")
library(portfolio)
Loading required package: grid
Loading required package: lattice
Loading required package: nlme
map.market(id=data$id, area=data$views, group=data$category, color=data$comments, main="FlowingData Map")