FAQ: Introduction to R Syntax - Calling a Function

This community-built FAQ covers the “Calling a Function” exercise from the lesson “Introduction to R Syntax”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn R

FAQs on the exercise Calling a Function

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

flip the order of round_up and round_down.

When using ceiling() and floor() on the numeric value 3.14, why does the ceiling() function round up the value to 4?

I tried printing both values in one line by writing the following:

print (round_down, round_up)

Only got the first value printed. When I printed the values separately, both worked fine. What is the problem with printing multiple values at once?


Hello, @dzham. Welcome to the forum.

Every language has it’s nuances. There are several ways to do what you suggest, but from what I can tell, using paste() seems to be the easiest for what you’ve attempted.
For example:

print(paste("Value One:", variable_one, "Value Two:", variable_two))

I’ve only dabbled in R a little bit so far myself, so you may find a better answer elsewhere. Happy coding!

1 Like


Just as the ceiling is at the top of a room (4) and the floor is at the bottom (3) for something in the middle (3.14), the functions round accordingly to the whole number above or below.

data ← c(120,22,22,31,15,120)

unique(data); #Outputs (120,22,31,15)

unique_vals = unique(data)


solution ← sqrt(49)


round_down ← floor(3.14)

round_up ← ceiling(3.14)



is the right answer.