Flat 10% & upto 40% off + 10% Cashback + Free additional Courses. Hurry up


Functions are the blocks of code that is written to perform particular job. R programming supports a huge number of in-built functions as well as user-defined ones. In order to create a function in R programming ‘function’ keyword is used.

The syntax for writing functions is-

function_name <- function (argu_1, argu_2, .... argu_N)


#Function body


For example, a function to calculate the power result of a number.

pow <- function(x, y) {

# function to print x raised to the power y

result <- x^y

print(paste(x,"raised to the power", y, "is", result))


Some of built-in functions are seq(),max(), mean(), sum(x), etc.

Calling a function

Taking the above example, a function can be called as follows:

>pow(8, 2)

Output- [1] “8 raised to the power 2 is 64”

"0 Responses on Functions"

Leave a Message

100% Secure Payments. All major credit & debit cards accepted Or Pay by Paypal.

Sales Offer

  • To avail this offer, enroll before 24th January 2018.
  • This offer cannot be combined with any other offer.
  • This offer is valid on selected courses only.
  • Please use coupon codes mentioned below to avail the offer

Sign Up or Login to view the Free Functions.