O'Reilly logo

Using R for Statistics by Sarah Stowell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

APPENDIX B

image

Basic Programming with R

As well being a statistical computing environment, R is also a programming language. The topic of R programming is beyond the scope of this book. However, this chapter gives a brief introduction to basic programming and writing your own functions.

When programming, use a script file so that you can edit your code easily. Remember to add plenty of comments with the hash symbol (#), so that your script can be understood by others or by yourself at a later date.

Creating New Functions

Throughout this book, you will have used many of R’s built-in functions, but it is also possible to create your own. Creating your ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required