Seite 1 von 1

Boxplot Darstellung fehlerhaft

Verfasst: Di Okt 22, 2024 9:56 pm
von Sebastian85
Hallo,
ich habe folgendes Problem:
Mein Datensatz sieht wie folgt aus:

Code: Alles auswählen

data_area=
# A tibble: 7 × 6
  Cells Total comb       Cells_p      
      <dbl>  <dbl> <chr>      <chr>           
1        26    2048 Control D0 1.26953125      
2        64   5999 Control D0 1.06684447407901
3        74    797 Control D1 9.28481806775408
4       936    5281 Control D1 17.7239159250142
5       718    4783 Control D2 15.0114990591679
6       660    4518 Control D2 14.6082337317397
7       512    3839 Control D2 13.3368064600156
Ich habe einmal die Zellenanzahl als absolute Zahl (Cells) und einmal in Prozent (Cells_p).
Warum funktioniert ein ggplot Boxplot nur bei den absoluten Zahlen??

ggplot(data=data_area, aes(x=comb, y=Cells))+
geom_boxplot()
Absolut (Cells).JPG
Danke und Gruß

ggplot(data=data_area, aes(x=comb, y=Cells_p))+
geom_boxplot()
Prozentual (Cells_p).JPG

Re: Boxplot Darstellung fehlerhaft

Verfasst: Mi Okt 23, 2024 7:56 am
von bigben
Hi!

Die Spalte Cells-p ist als Text <chr> markiert, nicht als Zahlenwet <dbl>. Versuch mal, die mit as.numeric() in ein Zahlenformat zu überführen.

LG,
Bernhard