Calculate cosine of a value in R Programming – cos() Function Improve Improve Improve Like Article Like Save Article Save Share Report issue Report cos() function in R Language is used to calculate the cosine value of the numeric value passed to it as argument. Syntax: cos(x) Parameter: x: Numeric value Example 1: # R code to calculate cosine of a value # Assigning values to variables x1 <- 90 x2 <- 30 # Using cos() Function cos(x1) cos(x2) Output: [1] -0.4480736 [1] 0.1542514 Example 2: # R code to calculate cosine of a value # Assigning values to variables x1 <- pi x2 <- pi / 3 # Using cos() Function cos(x1) cos(x2) Output: [1] -1 [1] 0.5 Last Updated : 01 Jun, 2020 Like Article Save Article Previous Rounding off to the ceiling or floor value in R Programming - trunc() Function Next Replace the First Match of a Pattern from a String in R Programming – sub() Function Share your thoughts in the comments Add Your Comment Please Login to comment...