R: test formula: does it contain a particular element?

inForm {glmmTMB} | R Documentation

## test formula: does it contain a particular element?

### Description

test formula: does it contain a particular element?

extract terms with a given head from an expression/formula

return a formula/expression with a given value stripped, where it occurs as the head of a term

drop terms matching a particular value from an expression

### Usage

    inForm(form, value)

    extractForm(term, value)

    dropHead(term, value)

    drop.special2(x, value = quote(offset), preserve = NULL)

### Arguments

`value` | head of terms to extract
`term` | expression/formula
`x` | formula
`preserve` | (integer) retain the specified occurrence of "value"
`value` | term to remove from formula

### Value

a list of expressions

### Examples

    inForm(z~.,quote(.))
    inForm(z~y,quote(.))
    inForm(z~a+b+c,quote(c))
    inForm(z~a+b+(d+e),quote(c))
    f <- ~ a + offset(x)
    f2 <- z ~ a
    inForm(f,quote(offset))
    inForm(f2,quote(offset))
    extractForm(~a+offset(b),quote(offset))
    extractForm(~c,quote(offset))
    extractForm(~a+offset(b)+offset(c),quote(offset))
    dropHead(~a+offset(b),quote(offset))
    dropHead(~a+poly(x+z,3)+offset(b),quote(offset))

[Package glmmTMB version 0.2.2.0 Index]