# AsIs

0th

Percentile

##### Inhibit Interpretation/Conversion of Objects

Change the class of an object to indicate that it should be treated ‘as is’.

Keywords
models
##### Usage
I(x)
x
an object
##### Details

Function I has two main uses.

• In function data.frame. Protecting an object by enclosing it in I() in a call to data.frame inhibits the conversion of character vectors to factors and the dropping of names, and ensures that matrices are inserted as single columns. I can also be used to protect objects which are to be added to a data frame, or converted to a data frame via as.data.frame.

It achieves this by prepending the class "AsIs" to the object's classes. Class "AsIs" has a few of its own methods, including for [, as.data.frame, print and format.

• In function formula. There it is used to inhibit the interpretation of operators such as "+", "-", "*" and "^" as formula operators, so they are used as arithmetical operators. This is interpreted as a symbol by terms.formula.

##### Value

A copy of the object with class "AsIs" prepended to the class(es).

##### References

Chambers, J. M. (1992) Linear models. Chapter 4 of Statistical Models in S eds J. M. Chambers and T. J. Hastie, Wadsworth & Brooks/Cole.

data.frame, formula

##### Aliases
• I
• AsIs
• print.AsIs
• [.AsIs
Documentation reproduced from package base, version 3.2.4, License: Part of R 3.2.4

### Community examples

mjchen.gene@gmail.com at May 13, 2019 base v3.6.0

Example of usage in formula. r data(iris) (mod1 <- lm(Sepal.Length ~ Petal.Length + Petal.Width, data = iris)) (mod2 <- lm(Sepal.Length ~ I(Petal.Length + Petal.Width), data = iris))