0

Why do i lose the order of my y-axis where the patient IDs are when I go from swimmer_plot, which works well, to +swimmer_points?

Any tips/tricks for improving my very rudimentary coding will be gratefully received ordered swimmer_plot disordered +swimmer_points

my code attempt

Thank you Ben

I tried making both data frames come from the same original CSV but then I couldnt even make a swim plot probably because of na.omit??? Tried a tonne of other stuff but I just started R yesterday so not really sure Thanks

  • Welcome to SO! It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. Please do not post an image of code/data/errors [for these reasons](https://meta.stackoverflow.com/questions/285551/why-not-upload-images-of-code-errors-when-asking-a-question/285557#285557). Just include the code, console output, or data (e.g., dput(head(x)) or data.frame(...)) directly. – stefan Oct 28 '22 at 03:48

1 Answers1

0

Without a reproducible example (as suggested in the comment by @stefan), I'm just guessing. But, usually it helps to create a factor and set the levels in the order you'd like. E.g., Pt <- factor(Pt, levels = unique(Pt)) or something similar. Maybe you need to use rev() on the levels.

RRDK
  • 86
  • 4