There is no "t" anywhere in my function but it still works, so because it confused me I tried to run this instead:
simu2<-function(t){
u<-runif(1,0,1)
return(u)
}
And again it worked, so I guess I don't understand clearly what runif does, is it actually a function ? I thought it could only generates random number that follow a uniform law.
You have set runif to give one sample in the range [0,1]. You can call simu() with or without a value of t because your function does not use t.
If you were to call simu() without a value of t and if simu() used t in some way, that would generate an error.