Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • Data Visualization
  • Statistics in R
  • Machine Learning in R
  • Data Science in R
  • Packages in R
  • Data Types
  • String
  • Array
  • Vector
  • Lists
  • Matrices
  • Oops in R
Open In App
Next Article:
Compute the Value of Poisson Density in R Programming - dpois() Function
Next article icon

Compute the cosine value which is multiples of pi in R Programming – cospi() Function

Last Updated : 08 Jun, 2020
Comments
Improve
Suggest changes
Like Article
Like
Report

cospi() function in R Language is used to compute the cosine value of x which is the multiples of pi.

Syntax: cospi(x)

Parameters:
x: Numeric value, array or vector

Example 1:




# R program to illustrate
# cospi function
  
# Calling the cospi() function
cospi(0)
cospi(1)
 
 

Output:

  [1] 1  [1] -1  

Example 2:




# R program to illustrate
# cospi function
  
# Calling the cospi() function
cospi(1 / 4)
cospi(2 / 5)
cospi(3 / 7)
 
 

Output:

  [1] 0.7071068  [1] 0.309017  [1] 0.2225209   


Next Article
Compute the Value of Poisson Density in R Programming - dpois() Function

K

Kanchan_Ray
Improve
Article Tags :
  • R Language
  • R Math-Function

Similar Reads

  • Compute the sine value which is multiples of pi in R Programming – sinpi() Function
    sinpi() function in R Language is used to compute the sine value of x which is the multiples of pi. Syntax: sinpi(x) Parameters: x: Numeric value, array or vector Example 1: # R program to illustrate # sinpi function # Calling the sinpi() function sinpi(0.5) sinpi(1) Output: [1] 1 [1] 0 Example 2: #
    1 min read
  • Compute the tangent value which is multiples of pi in R Programming – tanpi() Function
    tanpi() function in R Language is used to compute the tangent value of x which is the multiples of pi. Syntax: tanpi(x) Parameters: x: Numeric value, array or vector Example 1: # R program to illustrate # tanpi function # Calling the tanpi() function tanpi(0) tanpi(1 / 4) Output: [1] 0 [1] 1 Example
    1 min read
  • Compute the Value of Poisson Density in R Programming - dpois() Function
    dpois() function in R Language is used to compute the Poisson Density for a set of Integer values. It also creates a density plot of poisson distribution.  Syntax: dpois(vec, lambda)Parameters: vec: Sequence of integer values lambda: Average number of events per interval  Example 1:  [GFGTABS] Pytho
    1 min read
  • Compute the Value of Weibull Density in R Programming - dweibull() Function
    dweibull() function in R Language is used to compute the value of Weibull Density over different numeric values for Weibull Distribution. Syntax: dweibull(x, shape) Parameters: x: Numeric Vector shape: Shape Parameter Example 1: # R Program to compute # Weibull Density # Creating a sequence of x-val
    1 min read
  • Calculate cosine of a value in R Programming - cos() Function
    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(x
    1 min read
  • Calculate Inverse cosine of a value in R Programming - acos() Function
    acos() function in R Language is used to calculate the inverse cosine value of the numeric value passed to it as argument. Syntax: acos(x) Parameter: x: Numeric value Example 1: # R code to calculate inverse cosine of a value # Assigning values to variables x1 <- -1 x2 <- 0.5 # Using acos() Fu
    1 min read
  • Compute the Cumulative Poisson Density in R Programming - ppois() Function
    ppois() function in R Language is used to compute the cumulative density function for Poisson distribution. Syntax: ppois(vec, lambda) Parameters: vec: Sequence of integer values lambda: Average number of events per interval Example 1: # R program to compute # Cumulative Poisson Density # Sequence o
    1 min read
  • Compute the Value of Cumulative Weibull Density in R Programming - pweibull() Function
    pweibull() function in R Language is used to compute the value of Cumulative Distribution Function for Weibull Distribution. It also plots a density graph for Cumulative Weibull Function. Syntax: pweibull(x, shape) Parameters: x: Numeric Vector shape: Shape Parameter Example 1: # R Program to comput
    1 min read
  • Calculate the cross-product of a Matrix in R Programming - crossprod() Function
    crossprod() function in R Language is used to return the cross-product of the specified matrix. Syntax: crossprod(x) Parameters: x: numeric matrix Example 1: # R program to illustrate # crossprod function # Initializing a matrix with # 2 rows and 2 columns x <- matrix(1:4, 2, 2) # Getting the mat
    1 min read
  • Compute the Value of Poisson Quantile Function in R Programming - qpois() Function
    qpois() function in R Language is used to compute the value of Poisson Quantile Function. It creates a quantile density plot for poisson distribution. Syntax: qpois(vec, lambda) Parameters: vec: Sequence of integer values lambda: Average number of events per interval Example 1: # R program to comput
    2 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences