Help creating a basic function

Guys, please help!
I'm a beginner in R and I need to create a role for the following question:

"Create a function in R to extract the cube root of the 20th to 30th values of an objectSome β€œNA” values will show up as results. Use a function to save only numeric values to an object."

Tks :slight_smile:

Hi. First thing first, this appears to be a homework question, so please be aware of our homework policy. FAQ: Homework Policy. Please don't post homework questions verbatim like this.

A good place to get comfortable with R is the book, R4DS. It's free online at

It has a nice chapter on understanding and creating functions,

I'd work through this chapter and the examples provided, and see if you're able to create your function.

If you have specific questions, bring them back here. (Ideally with a reprex)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.