Skip to content
Related Articles

Related Articles

Improve Article
Convert Degree value to Radian value in R Programming – deg2rad() Function
  • Last Updated : 01 Jun, 2020

deg2rad() function in R Language is used to convert the specified degree value to radian value.

Note: This function requires ‘grid’ package to be installed.

Syntax: deg2rad(x)

Parameter:
x: degree value to be converted

Example 1:






# R code to convert degree value 
# to radian value
  
# Loading grid package
library(REdaS)
  
# Calling deg2rad() function
deg2rad(0)
deg2rad(30)
deg2rad(50)

Output:

Loading required package: grid
[1] 0
[1] 0.5235988
[1] 0.8726646

Example 2:




# R code to convert degree value 
# to radian value
  
# Loading grid package
library(REdaS)
  
# Calling deg2rad() function
deg2rad(60)
deg2rad(180)
deg2rad(-60)

Output:

Loading required package: grid
[1] 1.047198
[1] 3.141593
[1] -1.047198
My Personal Notes arrow_drop_up
Recommended Articles
Page :