I have an object called modelTrain
generated by the glm()
function. This object has several other objects like: coefficients
, formula
, terms
etc..
modelTrain<- glm(Def90Adj ~ .-1,data=base,family=binomial(link='logit'))
I have to change the name of some variables keeping the values used for prediction. One of objects in modelTrain
is of type 'call' (or 'language')
Its content is as follows:
attr(,"variables")
list(Def90Adj, `AveLncerLimiteRatio(0,1.04]`, `AveLncerLimiteRatio(1.04,3.96]`,
`AveLncerLimiteRatio(11.4,40.3]`, `AveLncerLimiteRatio(3.96,11.4]`,
`AveLncerLimiteRatio(40.3, Inf]`, `Ave6mEvoluçãoAvencerRatio(0, Inf]`,
`Ven6mEvoluçãoVencidoRatio(0.0001, Inf]`, `Ven6mEvoluçãoVencidoRatio[-Inf,-0.0001]`,
`Avvencer(0,1.01e+04]`, `AVBenNegAVenRatio(0, Inf]`,
`AVeNnNociAVenRatio(0, Inf]`, LimDummy, VencidoDummy,
PrejuDummy, AVedncerDummy)
I want to change the names with special characters like "Ven6mEvoluçãoVencidoRatio(0.0001, Inf]"
to "Ven6mEvolucaoVencidoRatio(0.0001, Inf]"
(without the special characters)
I tried copying the current content without the special characters
attr(modelTrain$terms, "variables") <- list((Def90Adj,AveLncerLimiteRatio(0,1.04]....
But it throws the error:
"Def90Adj" was not found.