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...


How would you write a custom function in r? Give an example.



How would you write a custom function in r? Give an example...

Answer / Awani Yadav

In R, you can define your own functions using the `function()` keyword. Here's an example of a simple custom function that calculates the factorial of a number: nn```rnfactorial <- function(n) {n if (n == 0) return(1)n else return(n * factorial(n - 1))n}n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More R Programming Interview Questions

Explain an extended example of connections?

1 Answers  


What will be the result of multiplying two vectors in r having different lengths?

1 Answers  


How to call c function from r?

1 Answers  


What are connections In R?

1 Answers  


What is the function in r?

1 Answers  


What is apply() function in r?

1 Answers  


What is Predictive analysis process in R?

1 Answers  


What are the applications of R?

1 Answers  


What is meant by ANOVA models in R?

1 Answers  


How can you debug and test r programming code?

1 Answers  


Which package provides the bootstrapping?

1 Answers  


Why the function anova()?

1 Answers  


Categories