Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autoplot fails on poly regression #140

Closed
DasHammett opened this issue Jan 5, 2017 · 3 comments
Closed

autoplot fails on poly regression #140

DasHammett opened this issue Jan 5, 2017 · 3 comments

Comments

@DasHammett
Copy link

Hi,

I get similar error message as in #137 when doing any polynomial regression.
Please see reproducible example:

library(ggfortify)
model <- lm(mpg ~ poly(hp, 2, raw = TRUE),data = mtcars)
autoplot(model)
Error: Each variable must be a 1d atomic vector or list.
Problem variables: 'poly(hp, 2, raw = TRUE)'

par(mfrow = c(2,2))
plot(model)
@terrytangyuan
Copy link
Collaborator

I am travelling and not able to help with this for a while. Are you using the most recent version on Github? cc: @sinhrks

@DasHammett
Copy link
Author

Hi!

No worries, you will have a look upon your return.
In the meantime I can still run the regression with formula = y ~ x + I(x²) as writing the regression like this works as expected.

The first thing I did is to use the github version, but unfortunately I experienced the same error.

Thank you for having a look when you can.

@sinhrks
Copy link
Owner

sinhrks commented Jan 6, 2017

@DasHammett thx for the report. the issue is caused by matrix contained in the explanatory values ( almost the same as #137). pls use the latest master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants