Contenu connexe
Plus de yogesh ingle (20)
Lecture 8 ba 8 r software
- 2. • Basic calculation
• c(12,22,33,49,58,67)^c(2)
• c(17,29,38,42,58,67)^c(2,3)
• c(13,28,37,49,54,67,72)^c(2,3)
• >c(12,21,37,44,51,6)*c(5,6)
• >c(17,25,33,47,51,69)+c(5,6)
• >c(17,27,31,49,57,62)/c(5,6)
• >c(1,27,37,41,58,63)-c(5,6)
- 3. • Integer Division
• >c(12,22,33,49,58,67)%/%c(2)
• >c(17,29,38,42,58,67)%/%c(2,3)
• Maximum
• >max(24.5,89,-25,79,78,25,125)
• Minimum
• >min(24.5,89,-25,79,78,25,125)
- 4. Other functions
•>abs(-25)
•>abs(c(45,-89,-78,5)
•>sqrt(729)
•>sqrt(c(45,9,729,-25)
•>sum(c(45,9,729,-25)
•>prod(c(45,9,729,-25)
•>round(c(45.5,9.89,72.9,-25,58)