On Apr 12, 2013, at 7:58 AM, Julio Sergio wrote:
Berend Hasselman xs4all.nl> writes:
Your function miBeta returns a scalar when the argument mu is a
vector.
Use Vectorize to vectorize it. Like this
VmiBeta <- Vectorize(miBeta,vectorize.args=c("mu"))
VmiBeta(c(420,440))
and draw the c
See below
On Fri, 12 Apr 2013, Julio Sergio wrote:
Berend Hasselman xs4all.nl> writes:
Your function miBeta returns a scalar when the argument mu is a vector.
Use Vectorize to vectorize it. Like this
VmiBeta <- Vectorize(miBeta,vectorize.args=c("mu"))
VmiBeta(c(420,440))
and draw the
Berend Hasselman xs4all.nl> writes:
>
> Your function miBeta returns a scalar when the argument mu is a vector.
> Use Vectorize to vectorize it. Like this
>
> VmiBeta <- Vectorize(miBeta,vectorize.args=c("mu"))
> VmiBeta(c(420,440))
>
> and draw the curve with this
>
> curve(VmiBeta,xli
Berend Hasselman xs4all.nl> writes:
>
> Yes. curve expects the function you give it to return a vector if the input
argument is a vector.
> This is clearly documented for the argument "expr" of curve.
Thanks a lot, Berend!
In fact, I didn't read carefully the documentation of "curve". Anyway
On 12-04-2013, at 05:15, Julio Sergio wrote:
> I thought the curve function was a very flexible way to draw functions. So I
> could plot funtions like the following:
>
> # I created a function to produce functions, for instance:
> fp <- function(m,b) function(x) sin(x) + m*x + b
> # So I
I thought the curve function was a very flexible way to draw functions. So I
could plot funtions like the following:
# I created a function to produce functions, for instance:
fp <- function(m,b) function(x) sin(x) + m*x + b
# So I can produce a function like this
ff <- fp(-0.08, 0.2)
6 matches
Mail list logo