Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2026 Crash Course
NEET 2026 Crash Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
97 views
in R by (178k points)
What are some built-in math functions in R?

Please log in or register to answer this question.

1 Answer

0 votes
by (178k points)

R provides a wide range of built-in math functions that can be used for complex calculations and mathematical operations. Some commonly used math functions in R include:

  • sqrt(x): Calculates the square root of the given number.
  • abs(x): Returns the absolute value of the given number.
  • ceiling(x): Rounds the given number up to the nearest integer.
  • floor(x): Rounds the given number down to the nearest integer.

These functions can be used to perform various mathematical operations and transformations in R. Here are some examples:

# Square root
result1 <- sqrt(16)
print(result1)  # Output: 4

# Absolute value
result2 <- abs(-10)
print(result2)  # Output: 10

# Ceiling
result3 <- ceiling(3.2)
print(result3)  # Output: 4

# Floor
result4 <- floor(3.9)
print(result4)  # Output: 3
 

Note: The examples above demonstrate the usage of individual math functions. However, these functions can be used in combination with other arithmetic operations and functions to perform more complex calculations.

Related questions

0 votes
1 answer
asked Jun 13, 2023 in R by kvdevika (178k points)
0 votes
1 answer
asked Jun 13, 2023 in R by kvdevika (178k points)
0 votes
2 answers
asked Jun 13, 2023 in R by kvdevika (178k points)
0 votes
1 answer
0 votes
1 answer

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...