delete_response() is exactly the same as delete.response(), except that it fixes a long standing bug by also removing the part of the "dataClasses" attribute corresponding to the response, if it exists.

delete_response(terms)

Arguments

terms

A terms object.

Value

terms with the response sections removed.

Details

The bug is described here:

https://r.789695.n4.nabble.com/delete-response-leaves-response-in-attribute-dataClasses-td4266902.html

Examples

framed <- model_frame(Species ~ Sepal.Width, iris) attr(delete.response(framed$terms), "dataClasses")
#> Species Sepal.Width #> "factor" "numeric"
attr(delete_response(framed$terms), "dataClasses")
#> Sepal.Width #> "numeric"