Skip to content

Statistics sometimes doesnt show above chart #971

@urosgodnov

Description

@urosgodnov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions