sign Function in R (Example) | How to Return Positive & Negative Values | Vector & Data Frame Column

Published: 10 December 2021
on channel: Statistics Globe
1,475
18

How to find out if a numeric value is positive or negative in the R programming language. More details: https://statisticsglobe.com/sign-func...
R code of this video:

sign(-2:5) # Apply sign function

set.seed(34532867) # Create random vector
x <- rnorm(100)
x # Print random vector

x_sign <- sign(x) # Sign of vector elements
x_sign

Follow me on Social Media:
Facebook – Statistics Globe Page:   / statisticsglobecom  
Facebook – Group for Discussions & Questions:   / statisticsglobe  
LinkedIn – Statistics Globe Page:   / statisticsglobe  
LinkedIn – Group for Discussions & Questions:   / 12555223  
Twitter:   / joachimschork  

Music by bensound.com


Watch video sign Function in R (Example) | How to Return Positive & Negative Values | Vector & Data Frame Column online without registration, duration hours minute second in high quality. This video was added by user Statistics Globe 10 December 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,475 once and liked it 18 people.