0

I am using R 3.4.3, and plotting the following function:

x =  rnorm(5000,20,30)
cdf_1 <- ecdf(x)  
plot(cdf_1, xlabs="x0",  
     ylabs="y0")

This gives me the following plot: enter image description here

Now, the plot doesn't take the given labels x0 and y0. How to solve this?

Also, how do I get the value of x for y=0.95. I have tried using label names, but it throws error. Kindly suggest.

rj dj
  • 260
  • 1
  • 5
  • 22

1 Answers1

1

The arguments for the labels are xlab and ylab (you added an extra s in both):

enter image description here

To find x for a y of 0.95 you can do:

x[which(cdf_1(x) == 0.95)]
#[1] 68.38452
LyzandeR
  • 37,047
  • 12
  • 77
  • 87