Plotting in R, error occurs

I want to plot a function but always get an error (see picture).
I don't know why my xlim isn't correct or what I should change to fix this...

plot(s, which=1:5, pch=1:3, xlab='logit', main=' ', xlim=range(s[,3:4]))

Schermafbeelding 2020-06-10 om 19.57.48

Try something like xlim = range(3:4,1])

Your code is saying read two columns and all the rows in the data set.

1 Like

I get a plot now, how do you know which range to take? Furthermore, I used this graphic since it is recommended to check the proportional odds assumption in an article. The only thing I don't really understand is what the 'pch' "does"? I already looked it up with '?' in R, but I still don't really get what is does?

*how do you know which range to take? *

I don't. It was just what was handy. It looks to me that you have a data.frame with at least one column so I just decided to plot a couple of data points in the first column of the data set. Thus range(3:4,1]) is simply saying use the third and fourth numbers in column 1 of the data set far the range

pch changes the shape of the plot symbol.
xx <- 1:20
plot(xx, pch = 1)
plot(xx, pch = 3)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.