O'Reilly logo

Learning Shiny by Hernán G. Resnizky

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

Chapter 2. First Steps towards Programming in R

This chapter is a general introduction to classes, objects, and functions in R. Now, we now know that R is an object-oriented language. Conceptually, as any other language of its kind, R has three main elements, as follows:

  • Classes
  • Objects
  • Functions

This chapter will cover the following topics:

  • Object-oriented programming (OOP) concepts in R
  • Vectors and arrays
  • Lists
  • Decision making and looping constructs

Object-oriented programming concepts

As in any other object-oriented programming language, a class in R is an abstract definition of an object type with specific attributes associated to it. For instance, for an eventual dog class (which is a general definition of a dog), we could say that it has the color ...

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