Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
R Data Structures and Algorithms

You're reading from   R Data Structures and Algorithms Increase speed and performance of your applications with effi cient data structures and algorithms

Arrow left icon
Product type Paperback
Published in Nov 2016
Publisher Packt
ISBN-13 9781786465153
Length 276 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (2):
Arrow left icon
Achyutuni Sri Krishna Rao Achyutuni Sri Krishna Rao
Author Profile Icon Achyutuni Sri Krishna Rao
Achyutuni Sri Krishna Rao
PKS Prakash PKS Prakash
Author Profile Icon PKS Prakash
PKS Prakash
Arrow right icon
View More author details
Toc

Object-oriented programming using R


As you already know, R is primarily a functional language; it also supports OOP. OOP in R is an archetype wherein objects and their interactions are used to design various generic functions. It defines the process of constructing modular bits of code, which can be integrated to form a large function. Some key concepts related to OOP are as follows:

  • Object: An instance of a class or an output of a function in R

  • Class: Used to define type and attributes of objects in R

  • Method: An implementation of a generic function for an object of a particular class

  • Generic function: A generalized function which calls multiple methods without performing any computation itself

R supports three forms of OOP systems based on different objects, classes, and methods:

  • S3: An informal, simple, interactive, and widely used OOP system in R. Basic packages such as base and stats are primarily built using the S3 system. The following are some generic functions built for multiple objects...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image