Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write a custom function in R?



Write a custom function in R?..

Answer / Rachna Saxena

To write a custom function in R, you can use the 'function' keyword. Here is an example:n```Rn# Custom function to calculate the factorial of a numbernfactorial <- function(n) {n if (n == 0) return(1)n else return(n * factorial(n - 1))n}n# Example usagenfibonacci <- factorial(5)n``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More R Programming Interview Questions

What is correlation? How would you measure correlation in r?

1 Answers  


Name the functions which helps in importing data from other applications in R?

1 Answers  


What are the features of r programming?

1 Answers  


How many control statements are present in r?

1 Answers  


What is function definition?

1 Answers  


What is R Base package?

1 Answers  


What is the difference between a bar-chart and a histogram? Where would you use a bar-chart and where would you use a histogram?

1 Answers  


How will you measure the probability of a binary response variable in r language?

1 Answers  


Explain how to save graphs in R?

1 Answers  


Why the stepaic()?

1 Answers  


In r how missing values are represented?

1 Answers  


What is a random forest? How do you build and evaluate a random forest in r?

1 Answers  


Categories