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

Error in [.data.frame(x, order(x, na.last = na.last, decreasing = decreasing)) : undefined columns selected #43

Open
genomix opened this issue Apr 15, 2018 · 1 comment

Comments

@genomix
Copy link

genomix commented Apr 15, 2018

I am trying to create a biplot using ggbiplot. I am almost there; howver, I just cannot seem to add the group names to my biplot. I converted the group column to dataframe and got the above error message. However, if I retain the group column as a vector, I get this error message: "Error in names(ell) <- *vtmp* :
'names' attribute [2] must be the same length as the vector [0]"
Rplot.pdf

g <- ggbiplot(pca_vistra_rms, obs.scale = 1, group=vistra.group, var.scale = 1, ellipse = TRUE, circle = TRUE)+ scale_color_discrete(name = '') + theme(legend.direction = 'horizontal', legend.position = 'top')
print(g)

@Hoohm
Copy link

Hoohm commented Apr 16, 2018

If you run with ellipse = FALSE it will run fine.

The issue is that you probably don't have enough samples per group to actually make the ellipses.

g <- ggbiplot(pca_vistra_rms, obs.scale = 1, group=vistra.group, var.scale = 1, ellipse = FALSE circle = TRUE)+ scale_color_discrete(name = '') + theme(legend.direction = 'horizontal', legend.position = 'top')
print(g)

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

2 participants