Reputation: 171
I plotted a single column in R with the code below
plot(datanew$cap)
But what I actually need is that the points on the x-axis should be on the y-axis while the point on the y-axis should be the x-axis. If anyone has an idea on how I can do this, I will greatly apreciate.
Upvotes: 0
Views: 121
Reputation: 3894
Plotting via
plot(datanew$cap)
is basically the same as
plot(seq(length(datanew$cap)), datanew$cap)
You can use this to your advantage by swapping the arguments (or specifiying x- and y-coordinates explicitly):
plot(x=datanew$cap, y=seq(length(datanew$cap)))
Upvotes: 2