David
David

Reputation: 524

Why the labels are not arranged properly in `stars()` in R?

I am using following function to generate stars(), one the visualization technique for multivariate data.

library(randomNames)
set.seed(3)
Name = randomNames(50, which.names = 'first')
height = sample(160:180, 50, replace = TRUE)
weight = sample(45:85, 50, replace = TRUE)
tumour_size = runif(50, 0,1)
df = data.frame(Name, height, weight, tumour_size, rnorm(50, 10,3))

stars(df,labels = Name)

But, I get the output like this:

enter image description here

How to align the names exactly below the stars?

Upvotes: 0

Views: 94

Answers (1)

jay.sf
jay.sf

Reputation: 73272

Use option flip.labels=FALSE.

stars(df, labels = Name, flip.labels = FALSE)

Result

enter image description here

Upvotes: 1

Related Questions