1

This is my data:

> ptm <- read.csv('ptm.csv')

> ptm
               Method X1HSTB X1I6WA X1U19A X1YSAC X1YTBA X2CDSA X5O38A
1 Class weighted loss   0.37   0.83   0.44   0.49   0.76   0.64   0.68
2                  OS   0.58   0.81   0.29   0.33   0.76   0.62   0.68
3  2 phase swapped OS   0.40   0.81   0.29   0.30   0.75   0.70   0.63
4        Thresholding   0.42   0.81   0.29   0.29   0.70   0.69   0.66
5  2 phase swapped US   0.43   0.80   0.27   0.29   0.71   0.66   0.54
6                  US   0.35   0.77   0.27   0.53   0.70   0.26   0.69
7          Unbalanced   0.43   0.69   0.27   0.34   0.70   0.44   0.52
8             Control   0.75   0.87   0.80   0.61   0.82   0.84   0.83

This is a rough idea of the plot I'd like to make: [1]: https://i.sstatic.net/0KlX1.png

This is what I tried:

> ptm_plot <- ggplot(data=ptm, aes(x="1HSTB", "1I6WA", "1U19A", "1YSAC",      
"1YTBA","2CDSA", "5O38A",
  y=X1HSTB, X1I6WA, X1U19A, X1YSAC, X1YTBA, X2CDSA, X5O38A, colour=Method)) + 
  geom_point(stat="identity")
> ptm_plot

This was the result: [2]: https://i.sstatic.net/ZveLo.png

It's close to what I want but I can't seem to get all my columns in there. Any help would be appreciated!

2

1 Answer 1

1

We may need to reshape to 'long' format

library(dplyr)
library(tidyr)
ptm %>%
   pivot_longer(cols = -Method) %>%
   ggplot(aes(x = name, y = value, fill = Method)) + 
    geom_point(stat = 'identity')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.