Hi,
I try to put an equation on a object to use in curve for example,
but it don't work, it possible to make a object of an equation?
ex.
fx <- a + b*x
for(a in 0){for(b in 1){curve(fx,...)}}
Thanks you
Ronaldo
ps. Exist in R any functions to estimate severals curves parameters (non
interactive) for a dataset? Something like table-curve 2d.
--
If Karl, instead of writing a lot about Capital, had made a lot of Capital,
it would have been much better.
-- Karl Marx's Mother
--
| //|\\ [*****************************][*******************]
|| ( ? ? ) [Ronaldo Reis J?nior ][PentiumIII-600 ]
| V [ESALQ/USP-Entomologia, CP-09 ][HD: 30 + 10 Gb ]
|| / l \ [13418-900 Piracicaba - SP ][RAM: 128 Mb ]
| /(lin)\ [Fone: 19-429-4199 r.229 ][Video: SiS620-8Mb ]
||/(linux)\ [chrysopa at insecta.ufv.br ][Modem: Pctel-onboar]
|/ (linux) \[ICQ#: 5692561 ][Kernel: 2.4.18 ]
|| ( x ) [*****************************][*******************]
||| _/ \_Powered by Gnu/Debian Woody D+:) | Lxuser#: 205366
On Thu, 12 Dec 2002, Ronaldo Reis Jr. wrote:> Hi, > > I try to put an equation on a object to use in curve for example, > but it don't work, it possible to make a object of an equation? > > ex. > > fx <- a + b*x > for(a in 0){for(b in 1){curve(fx,...)}} >It's tricky because curve allows both expressions and functions as arguments. Your example couldn't work because fx <- a + b*x sets fx to a number (or vector), the number a+b*x. You would want fx <- expression(a+b*x) or fx <- quote(a+b*x) to store the expression "a+b*x" Now, could reasonably be expected to work, but doesn't. It doesn't because curve assumes that its argument is a literal expression involving x or a function. So you need to do either for(a in 0){for(b in 1){curve(a+b*x)}} or fx<- function(x) a+b*x for(a in 0){for(b in 1){curve(fx)}} -thomas