Hi:
Borrowing from this thread, courtesy of Brian Diggs:
http://groups.google.com/group/ggplot2/browse_thread/thread/478f9e61d41b4678/ed323c497db61156?lnk=gst&q=stat_function#ed323c497db61156
...here's a small reproducible example:
ddf <- data.frame(x = 1:10, y = 0.4 + 0.6 * (1:10) + rnorm(10))
Thanks Rainer. I did not know about dput(). Here is the data.
mom_hs <- c(1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0,
1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 1, 1,
0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1,
On 27/07/2011 9:21 AM, dean123 wrote:
Hi David,
I am trying to define t as a single numeric value and not as a vector.. I
want the function to realise that if I call test(t) and t is less than equal
10 return zero, if t greater than 10 return 2*t. Am i missing some code in
which to define t a nu
Hi David,
I am trying to define t as a single numeric value and not as a vector.. I
want the function to realise that if I call test(t) and t is less than equal
10 return zero, if t greater than 10 return 2*t. Am i missing some code in
which to define t a numeric value instead of a vector?
Also,
On Jul 27, 2011, at 3:01 AM, dean123 wrote:
I am trying to plot the following function over the range 0-100
test <- function(t){{
if (t<=10)
x<-t*0
else x<-2*t
}
x
}
Two problems I see. The first is the one described fairly clearly by
the error message:
Read:
?"if"
It is not designed
Take a look at the examples in ?curve. As suggested by Erik, in the
future please read the posting guide so you can get a more accurate
response.
Regards,
Francisco
Dr. Francisco J. Zagmutt
Vose Consulting
1643 Spruce St., Boulder
Boulder, CO, 80302
USA
www.voseconsulting.com
Jin wrote:
He
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Jin wrote:
Hello Dear,
I am trying to plot a function to see a minimum point (actually, using
"optim"). For example,
1. y=f(x)
2. x has a range
3. pl
Thank you for your replies. I figured out that curve has an option of add
which adds it to a previously existing graph.
Thank you,
Amit
On Fri, May 9, 2008 at 10:07 AM, Amit Soni <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a histogram of an array of numbers.
> hist(v,10)
>
> How can I plot a fun
8 matches
Mail list logo