How do I get a parameter in a chart label?
I'm sure you can help me: I created some function that depends on some parameters (like n). Then I plot the density and I want to tag it with n entered as a function parameter. To be more specific:
plot(function(x) dnorm(x,0,1), main="n=...")
lines(density(y), col = 'red')
I want "..." to be 100 automatically when I used my function with n = 100 (instead of always editing the function).
Thanks in advance!
+3
source to share