In R, the glm regression glm creates an object of class glm , which is a list.
Like a list, I should be able to view an object of the glm class as a list without any formatting. However, as.list does not seem to do this.
For example, if fit is the model installed by the glm function:
> as.list(fit) Call: glm(formula = V4 ~ V3 + V2 + V1, family = Gamma, data = data) Coefficients: (Intercept) V3 V2 V1 1.349 1.593 1.577 1.127 Degrees of Freedom: 9999 Total (ie Null); 9996 Residual Null Deviance: 2137 Residual Deviance: 2048 AIC: -30180
On the other hand, other functions that apply to the list work correctly, for example names , which will create 30 names of the corresponding list.
In addition, I can view individual items in the same way as for any other list:
> fit$coefficients (Intercept) V3 V2 V1 1.349282 1.593067 1.576868 1.127067
Is there any pre-existing function that allows me to view fit in my list form without formatting?
As I said above, I could create my own function using list names, but this is not necessary for such a simple task.
source share