Generate multiple plots of "p" and "se"


p <- seq(0, 1, length = 100)

sample_sizes <- c(25, 100, 1000)

for(N in sample_sizes){
  
    se <- sqrt(p * (1 - p) / N)
    
    plot(x = p, y = se, ylim = c(0, 25))  
    
    }                          

Am I defining the loop constructor and loop body correctly ?

What is the standard way to calculate the "max" argument to the "ylim" function ? I just used the smallest "N" value in the "sample_sizes" vector. should it be with something like "0.5 / sqrt(25) or sqrt(25) ?

I'm not sure what the 'standard' way to calculate limits is, but R usually comes up with sensible defaults. If you omit ylim, you get:

Did you want all three of these plots to have a common scale, for comparison purposes?

it is a datacamp exercise and i dont remember what the purpose of setting the "max" arg in "ylim" was. maybe it was for a common scale and /or they just wanted us to figure out how to set it. they gave us the "min" value and left the "max" up to us. a lot of the examples i saw online just used a simple integer instead of the sqrt() or some other computation.