chap1-Intro to basics
How it works
- In the editor on the right you should type R code to solve the exercises.
- R makes use of the # sign to add comments, so that you and others can understand what the R code is about. Just like Twitter! Comments are not run as R-code,so they will not influence your result.
- The ouput of your R code is shown in the console int the lower right corner, while graphs are shown in the upper right corner.
Instructions
- In its most basic form, R can thus be used as a calculator or as a means to generate plots, but there is much more;-)!
- You can see that R has generated some cool visualizations in the upper right corner. Use the arrows above the graphs to browse through these.
Exercises
1 | # show some demo graphs generated with R |
1 | > require(datasets) |
1 | > abline(h = 0, col = gray(.90)) |
1 | > title(main = "A Sample Color Wheel", cex.main = 1.4, font.main = 3) |
1 |
|
1 |
|
1 |
|
1 |
|
1 | > title(main="1000 Normal Random Variates", font.main=3) |
1 | pairs(iris[1:4], main="Edgar Anderson's Iris Data", pch=21, |
1 | > ## Contour plotting |
1 | > usr <- par("usr") |
1 | > par(opar) |
1 | # Calculate 3+4 |
Next Tutorial
- 本文标题:chap1-Intro to basics
- 创建时间:2014-11-18 20:09:15
- 本文链接:2014/11/18/技能-修行-进步-R语言/chap1-Intro-to-basics/
- 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
评论