Displaying 12 results from an estimated 12 matches for "tmpfun".
Did you mean:
cmpfun
2003 Apr 04
3
creating function bodies using body()
I'm having trouble figuring out how to create a function using "body<-"
(). The help file for body() says that the argument should be a list of
R expressions. However if I try that I get an error:
> tmpfun <- function(a, b=2){}
> body(tmpfun) <- list(expression(z <- a + b),expression(z^2))
Error in as.function.default(c(formals(f), value), envir) :
invalid formal argument list for "function"
Can someone give me a simple example for doing this? Thanks!
R. Woodrow Setze...
2007 Sep 17
4
graphs with gradients of colors
Hi All,
I would like to fill the area under a curve with a gradient of colors. Are there any packages or trick I could use
Thanks
Stefan
Stefan Van Dongen
Antwerp
[[alternative HTML version deleted]]
2004 Nov 18
0
Calling Rdqags doesn't produce correct result.
...double *abserr,
int *neval,
int *ier,
int *limit,
int *lenw,
int *last,
int *iwork,
double *work,
double *exx)
{
void *ex;
ex = exx;
Rdqags(tmpfun, ex, a, b, epsabs, epsrel,
result, abserr, neval, ier,
limit, lenw, last, iwork, work);
}
// User supplied function
void tmpfun(double *x, int n, void *ex)
{
int i;
double *tmp;
tmp = (double *)ex;
// for(i=1;i<=n;i++)...
2010 Feb 26
3
Preserving lists in a function
Dear R users,
A co-worker and I are writing a function to facilitate graph plotting in R. The function makes use of a lot of lists in its defaults.
However, we discovered that R does not necessarily preserve the defaults if we were to input them in the form of list() when initializing the function. For example, if you feed the function codes below into R:
myfunction=function(
list1=list
2008 Oct 25
2
how to plot chi-square distribution in the graph
if i want to plot the chi-square distribution with a different degree of
freedom how can i plot it in the graph?Sometimes i plot the histogram and
cut it in a lot of piece.It's distribution like a chi-square.So i want to
plot the chi-square with a different degree of freedom to compare it .
--
View this message in context:
2010 Jun 10
2
points marking
Hi,
How to mark points on x axis of a graph keeping x axis as constant and
changing y from y1 to y2 respectively. I want to highlight the area from y1
to y2.
Any suggestions
Thank you
Jeet
[[alternative HTML version deleted]]
2008 Dec 08
1
Multivariate kernel density estimation
I would like to estimate a 95% highest density area for a multivariate
parameter space (In the context of anova). Unfortunately I have only
experience with univariate kernel density estimation, which is remarkebly
easier :)
Using Gibbs, i have sampled from a posterior distirbution of an Anova model
with k means (mu) and 1 common residual variance (s2). The means are
independent of eachother, but
2009 Jul 23
1
help with randomisation test...
Dear R-people,
I hope asking this is not too cheeky, but I do have a R Problem. I hope
that some of you like to play around with R and can help me.
Its like this. I have several plant species (A,B,C) and 10 replicates
per species. 5 plants per species are damaged, 5 not. I let a
caterpillar feed on each plant and measured the growth of the
caterpillars on control plants (CR) and on damaged
2012 Apr 09
3
Gradients in bar charts XXXX
Hello, I have a graphics-related question:
I was wondering if anyone knows of a way to create a bar chart that is colored with a three-part gradient that changes at fixed y-values. Each bar needs to fade green-to-yellow at Y=.10 and from yellow-to-red at Y=.20. Is there an option in a package somewhere that offers an easy way to do this?
Attached is a chart I macgyvered together in Excel using a
2010 Sep 10
6
adding zeroes after old zeroes in a vector ??
Hello
Imagine I have a vector with ones and zeroes
I write it compactly:
1111111100001111111111110000000001111111111100101
I need to get a new vector replacing the "N" ones following the zeroes to
new zeroes.
For example for N = 3
1111111100001111111111110000000001111111111100101 becomes
1111111100000001111111110000000000001111111100000
I can do it with a for loop but I've read
2008 Aug 04
5
Are there any guis out there, which will allow editing of the graph?
Hi, all,
I would like to know if there is any gui interface out there
(academic or commercial) that allows one to edit R-language generated
graphs (e.g positioning x axis labels.) It would be nice to have
something like the user interface of Igor or Origin. I have already
used JGR and R-gui. These are good, but they don't allow one to
easily edit graphs. I have also tried
2008 Aug 15
6
continuous coloring of a polygon
R2.7.1, WinXP
Hi,
I have a polygon inside a circle as follows:
radius <- 3
x <- seq(-radius,radius,length=2000)
y <- sqrt(radius^2-x^2)
xx <- c(x,-x)
yy <- c(y,-y)
plot(xx,yy, xlim=c(-radius,radius),ylim=c(-radius,radius), type="l",
ylab="", xlab="", axes=F)
radius <- 2.7
x1 <- seq(-radius,radius,length=2000)
y1 <- sqrt(radius^2-x1^2)