Графики

Данные точности классификации моторного воображения ног. electrodes - количество электродов, accurasy - точность. Для анализа ранее мне необходимы были боксплоты, поэтому далее представлены боксплоты

library(readxl)
## Warning: пакет 'readxl' был собран под R версии 4.2.3
data <- read_excel('df.xlsx.')
summary(data)
##   electrodes           accuracy    
##  Length:24          Min.   :31.75  
##  Class :character   1st Qu.:34.96  
##  Mode  :character   Median :36.66  
##                     Mean   :37.83  
##                     3rd Qu.:40.00  
##                     Max.   :51.43

Некрасивый график

library (tidyverse)
## Warning: пакет 'tidyverse' был собран под R версии 4.2.3
## Warning: пакет 'tibble' был собран под R версии 4.2.3
## Warning: пакет 'tidyr' был собран под R версии 4.2.3
## Warning: пакет 'purrr' был собран под R версии 4.2.3
## Warning: пакет 'dplyr' был собран под R версии 4.2.3
## Warning: пакет 'forcats' был собран под R версии 4.2.3
## Warning: пакет 'lubridate' был собран под R версии 4.2.3
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.4
## ✔ forcats   1.0.0     ✔ stringr   1.5.0
## ✔ ggplot2   3.4.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.0
## ✔ purrr     1.0.1     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the ]8;;http://conflicted.r-lib.org/conflicted package]8;; to force all conflicts to become errors
gr_eeg <- ggplot(data = data, 
                 aes(x = accuracy , y = electrodes, color = "red"))+
  geom_boxplot(fill="red", alpha=1, linetype = 6, notch = TRUE) +
  geom_point(size = 5, shape = 17, colour = "green") +
  theme(plot.background = element_rect(fill = "blue"),
        plot.title = element_text(size = 20, hjust = 0.25, colour = "greenyellow"),
        plot.subtitle = element_text(size = 20, hjust = 0.75, color = "mediumvioletred", family = "serif"),
        plot.caption = element_text(size = 20, face = "italic", angle = 180, colour = "turquoise"),
          panel.background = element_rect(fill = 'magenta', colour = 'orange', size = 4),
         axis.title.x = element_text(color = "yellow", size = 10, family = "serif"),
        axis.title.y = element_text(family = "mono", face = "bold", size = 20, hjust = 0.25, colour = "red"))+
  labs(title = "LEG MOTOR IMAGERY ACCURACY",
       subtitle = "EEG",
       caption = "Ugly boxplots",
       col = "Legend")+
  xlab ("aCcUrAcY")+
  ylab ("ELRCTRODES")
## Warning: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
## ℹ Please use the `linewidth` argument instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
gr_eeg
## Notch went outside hinges
## ℹ Do you want `notch = FALSE`?
## Notch went outside hinges
## ℹ Do you want `notch = FALSE`?
## Notch went outside hinges
## ℹ Do you want `notch = FALSE`?
## Notch went outside hinges
## ℹ Do you want `notch = FALSE`?

## Красивый график

gr_eeg <- ggplot(data = data, 
                    aes(x = electrodes, y = accuracy, color = electrodes)) +
  geom_boxplot() +
  geom_jitter(width = 0.25) +
  xlab("electrodes")
gr_eeg

Note that the echo = FALSE parameter was added to the code chunk to prevent printing of the R code that generated the plot.