This seems like a trivial R question, but I didn’t find any convincing solution. I would like to flip my plot where the X axis become Y, and vice-versa. In boxplot there is an horiz="T" option, but not in plot().
This is what I plot :
plot(rm, type="l", main="CpG - running window 100")
> str(rm)
num [1:43631] 0.667 0.673 0.679 0.685 0.691 ...

And I would like to obtain this :

Thanks for the feedback.
I think the problem is because the plot doesn’t explicitly have an index. Try the following:
This is similar what you have. It is also equivalent to
plot(1:length(a), a, ...)where1:length(a)is yourxandais youry.Keeping the above in mind, we can flip your chart like this: