I still do not see the problem. I would try shutting down Rstudio and restarting it, because I always try that when things are weird. Also please post the output of running sessionInfo()
. I will post mine below the reprex.
library(tidyverse)
#> Warning: package 'tibble' was built under R version 4.1.2
data_bds <- structure(list(Proband = structure(c(7L, 8L, 6L, 3L, 10L, 4L,
5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L,
7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L,
10L, 4L, 5L, 1L, 2L, 9L, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L,
9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, 7L, 8L, 6L,
3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L,
1L, 2L, 9L, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L,
8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, 7L, 8L, 6L, 3L, 10L, 4L,
5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L,
7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L,
10L, 4L, 5L, 1L, 2L, 9L, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L,
9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, 7L, 8L, 6L,
3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L, 8L, 6L, 3L, 10L, 4L, 5L,
1L, 2L, 9L, 7L, 8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L, NA, 7L,
8L, 6L, 3L, 10L, 4L, 5L, 1L, 2L, 9L), .Label = c("15", "151",
"152", "153", "154", "155", "156", "158", "162", "163"), class = "factor"),
Interventionsseite = structure(c(1L, 1L, 1L, 1L, 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3L, 3L, 3L, 3L, 3L,
3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L,
4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
4L, 4L, 4L, 4L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L, 6L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L,
6L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L
), .Label = c("0", "1", "2", "3", "4", "5", "6", "7", "8",
"9"), class = "factor"),
v = c(0, 0, 0, 0, 0, 0, 0, 0, 0,
0, NA, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5.39999999999999, 12.1,
-9.8, -5, 6.5, -13.9, -23.7, 0.349999999999994, -13.5, -8.39999999999999,
NA, -1.9, -0.600000000000009, 0.700000000000003, -4.15000000000001,
-2.8, -3.39999999999999, 1.35000000000001, -5.15000000000001,
-1.85, -4.7, 5.7, 9.8, -22.7, -6.6, -2.8, -11.5, -24.3, 4.8,
-16, -8.14999999999999, NA, -2.5, 3.59999999999999, -0.799999999999997,
-4.7, -2.75, -7.89999999999999, 2.80000000000001, -1.35000000000001,
-5.3, -0.400000000000006, 5.5, 5.5, -23.9, -8.3, -14.35,
-10, -23.3, 4.89999999999999, -15.8, -9.59999999999999, NA,
-2.4, 4.2, -1.2, -6.75, 0.349999999999994, -11.6, 5.85000000000001,
-5.05000000000001, -4.2, -7.55, 5.5, 9.8, -25.6, -7.45, -11.4,
-6.30000000000001, -26.2, 1.8, -18, -10.4, NA, 2.4, 2.2,
-4.59999999999999, -3.80000000000001, 0.550000000000011,
-5.19999999999999, 1.90000000000001, -5.45000000000002, -5.7,
-10.3, 7.09999999999999, 14.8, -23.7, -3.6, -12.5, -6.50000000000001,
-28.8, -2.65000000000001, -18.7, -11.2, NA, 1.7, -3.60000000000001,
-5.5, -1.95, -1.44999999999999, -3.49999999999999, -7.90000000000001,
-6.65000000000001, -12.3, -11.8, 0.5, 2, -24.2, -2.5, -25.6,
-5.20000000000002, -29.8, -0.150000000000006, -22.15, -10.6,
NA, 4.9, -4.2, -6.59999999999999, -2.5, -11.85, -1.74999999999999,
-21.9, -4.7, -11.2, -12.6, -5.2, 2.1, 19.2, 6.09999999999999,
-0.599999999999994, 8.39999999999999, -4.3, 6.89999999999999,
9.39999999999999, -2.8, NA, 4.5, -3.7, -3.5, 0.25, -13.05,
-2.99999999999999, -22.95, -5.90000000000001, -11.05, -13.4,
-14.8, 5.8, 16.8, 3.95, -0.399999999999991, 10.65, 3.90000000000001,
3.2, 11.3, 0.600000000000009, NA, 3.4, -3.7, -4.5, -1.85000000000001,
-18.05, -0.549999999999983, -26.6, -4.35000000000001, -12.7,
-11.1, -15.3, 5.7, 7.3, 3.05, -5.2, 7.69999999999999, -9.44999999999999,
1.89999999999999, 3.39999999999999, -4.14999999999999, NA,
4.8, -3.40000000000001, -7.09999999999999, -0.200000000000003,
-16.35, -2.49999999999999, -27.25, -6.55000000000001, -13.6,
-13.1)),
row.names = c(NA, -210L), class = c("tbl_df", "tbl","data.frame"))
pd = position_dodge(width = 0.5)
ggplot(data=data_bds,mapping = aes(x=t,y=v,fill=Interventionsseite))+
geom_hline(yintercept = 0,size=0.6,color="gray",linetype=2)+
stat_boxplot(geom = 'errorbar', position=pd, width=0.25)+
geom_boxplot(outlier.colour = "white",width=0.4, position=pd)+
scale_x_discrete(name="Zeitfenster",label=c("t0'",
"2'","5'", "15'","30'","60'","90'","p2'",
"p10'","p20'"))+
scale_y_continuous(name = "<U+0394>-TOI in mlO2/min/100g",
breaks = seq(-40,30,by=10),limits = c(-40,30))+
scale_fill_manual(values=c("gray35","gray96"),
name=NULL,labels=c("Interventionsseite","Kontrollseite"))+
theme(legend.position = "bottom")+
theme(panel.background = element_blank(),legend.key = element_blank())+
theme( axis.line=element_line(size=1/10,
color='black'))+
theme(axis.text.x=element_text(size=11))+
theme(axis.text.y = element_text(size=11))
#> Warning: Removed 10 rows containing non-finite values (stat_boxplot).
#> Warning: Removed 10 rows containing non-finite values (stat_boxplot).
Created on 2022-02-08 by the reprex package (v2.0.1)
sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] forcats_0.5.1 stringr_1.4.0 dplyr_1.0.7 purrr_0.3.4
[5] readr_2.0.2 tidyr_1.1.4 tibble_3.1.6 ggplot2_3.3.5
[9] tidyverse_1.3.1
loaded via a namespace (and not attached):
[1] tidyselect_1.1.1 xfun_0.26 haven_2.4.3 colorspace_2.0-2
[5] vctrs_0.3.8 generics_0.1.0 htmltools_0.5.2 yaml_2.2.1
[9] utf8_1.2.2 rlang_0.4.11 pillar_1.6.3 glue_1.4.2
[13] withr_2.4.2 DBI_1.1.1 dbplyr_2.1.1 modelr_0.1.8
[17] readxl_1.3.1 lifecycle_1.0.1 munsell_0.5.0 gtable_0.3.0
[21] cellranger_1.1.0 rvest_1.0.1 evaluate_0.14 labeling_0.4.2
[25] knitr_1.36 callr_3.7.0 fastmap_1.1.0 tzdb_0.1.2
[29] ps_1.6.0 fansi_0.5.0 highr_0.9 broom_0.7.9
[33] Rcpp_1.0.7 clipr_0.7.1 scales_1.1.1 backports_1.2.1
[37] jsonlite_1.7.2 farver_2.1.0 fs_1.5.0 hms_1.1.1
[41] digest_0.6.28 stringi_1.7.4 processx_3.5.2 grid_4.1.1
[45] cli_3.0.1 tools_4.1.1 magrittr_2.0.1 crayon_1.4.1
[49] pkgconfig_2.0.3 ellipsis_0.3.2 xml2_1.3.2 reprex_2.0.1
[53] lubridate_1.7.10 assertthat_0.2.1 rmarkdown_2.11 httr_1.4.2
[57] rstudioapi_0.13 R6_2.5.1 compiler_4.1.1