freegroup (version 1.1-0)

abs.free: Absolute value of a free object

Description

Replaces every term's power with its absolute value

Usage

# S3 method for free
abs(x)

Arguments

x

Object of class free

Details

Replaces every term's power with its absolute value

See Also

subs

Examples

Run this code
# NOT RUN {
abs(abc(-5:5))

a <- rfree(10,4,7)
b <- rfree(10,4,7)

a
abs(a)

## following should all be TRUE:
all(size(abs(a+b))  <=  size(abs(a) + abs(b)))
all(total(abs(a+b)) <=  total(abs(a) + abs(b)))
all(number(abs(a+b)) <= number(abs(a) + abs(b)))

all(size(a+b)   <= size(abs(a) + abs(b)))
all(total(a+b)  <= total(abs(a) + abs(b)))
all(number(a+b) <= number(abs(a) + abs(b)))

# }

Run the code above in your browser using DataCamp Workspace