How to Apply the sign() Function in R (Example Code)

In this post you’ll learn how to find out if a numeric value is positive or negative in the R programming language.

Example: Return Sign of Numeric Value

sign(-1:3)        # Applying the sign function in R
# -1  0  1  1  1

Leave a Reply

Your email address will not be published.

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed

Menu
Top