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

Statistics sometimes doesnt show above chart #971

Open
urosgodnov opened this issue Nov 10, 2024 · 0 comments
Open

Statistics sometimes doesnt show above chart #971

urosgodnov opened this issue Nov 10, 2024 · 0 comments

Comments

@urosgodnov
Copy link

When I run a code:

dri<-data_cleanK |>
dplyr::filter(odgovor=="telesna dejavnost") |>
dplyr::select(selected_value,izobrazba)

I get the following result:

A tibble: 1,501 × 2
selected_value izobrazba

1 1 višja
2 1 strokovna šola
3 0 srednja/gimnazija
4 1 srednja/gimnazija
5 0 < PŠ
6 1 srednja/gimnazija
7 0 strokovna šola
8 0 srednja/gimnazija
9 0 univerzitetna

When I use this data, I get

g<-ggbarstats(
data = dri,
results.subtitle=TRUE,
x = selected_value,
y = izobrazba,
type="parametric",
fill=odgovor,
bf.message = FALSE,
proportion.test=FALSE
)

image

extract_stats(g)
$subtitle_data
NULL

I was then thinking, why sometimes it does work and sometimed doesnt. And the only difference I could find, were special characters in izobrazba column.

Then I ran:

dri<-data_cleanK |>
dplyr::filter(odgovor=="telesna dejavnost") |>
dplyr::select(selected_value,izobrazba)|>
mutate(izobrazba=str_replace_all(izobrazba,"[<./]",""))

And statistic works.

image

Apparently we cannot use dedicated characters in our labels.

Uros

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

1 participant