similar to: Return od functions

Displaying 20 results from an estimated 6000 matches similar to: "Return od functions"

2011 Aug 02
3
Inverse of FAQ 7.31.
Why does R think these numbers ***are*** equal? In a somewhat bizarre set of circumstances I calculated x0 <- 0.03580067 x1 <- 0.03474075 y0 <- 0.4918823 y1 <- 0.4474461 dx <- x1 - x0 dy <- y1 - y0 xx <- (x0 + x1)/2 yy <- (y0 + y1)/2 chk <- yy*dx - xx*dy + x0*dy - y0*dx If you think about it ***very*** carefully ( :-) )
2009 Nov 04
1
cascade option for dev.new?
I frequently run scripts that generate multiple graphs. Unless you specify a specific window location, dev.new superimposes all new graphics windows exactly on top of each other. It would be nice to have a "cascade=TRUE" option in dev.new to prevent windows from being hidden. A hasty approximation to this is the following function: # utility function to prevent overlapping plot
2003 Jan 24
4
new function: showcolors {base}
I propose to add a function that allows to display colors selected by a text pattern or by color vectors in a plot. Wolfram Fischer #--- showcolors.R showcolors <- function( col = "red" , index = NULL , pie = TRUE , lwd = 6 , cex = 1.0 , main = NULL , sub = NULL , ... ){ n.colors <- length( col ) if( n.colors > 1 ){ main <- deparse( substitute( col ) )
2011 Aug 12
1
deSolve output
Hi, I've solved a simple differential equation describing the degradation of amino acid carbon (THAA-C) using deSolve. Code is a follows: # Input of model parameters, a and b describes form of curve, i is apparent initial age of Org. C. parameters <- c(a = a, b = b, i=i) # Initial value of the model, G state = c(G = G) #specifies the function degradation as a function of
2003 Nov 05
3
using LSODA in R
R help list subscribers, I am a new user of R. I am attempting to use R to explore a set of equations specifying the dynamics of a three trophic level food chain. I have put together this code for the function that is to be evaluted by LSODA. My equations Rprime, Cprime, and Pprime are meant to describe the actual equation of the derivative. When I run LSODA, I do not get the output that
2009 Jun 19
1
Drawing dendrogram
Dear all, I would like to draw a dendrogram and mark some parts/branches (by using "segments") including their labels. If I draw it without specifying the length of x axix, I am able to do that (as in My dendrogram 1 of the following codes). However, if I want to specify the x axix, I am not able to draw marking line (by using "segments") including labels (as in My dendrogram
2000 Nov 26
5
Another good optimization (for PPC only, though)
Using the PPC frsqrte and fres instructions, I got the percentage time take in the smoothing code in _vp_compute_mask() down from 13.64% to 1.88% of the running time. In my local copy of Vorbis I have a fast_math.[hc] in vorbis/lib and have a _fast_sqrt() inline in fast_math.h. If anyone else wants to try it out, it follows. I can currently encode my test file (the first 15 seconds of
2009 May 26
2
using lsoda() and nls() together
Thanks to Dieter Menne and Spencer Graves I started to get my way through lsoda() Now I need to use it in with nls() to assess parameters I have a go with a basic example dy/dt = K1*conc I try to assess the value of K1 from a simulated data set with a K1 close to 2. Here is (I think) the best code that I've done so far even though it crashes when I call nls()
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2010 Apr 29
1
Request - adding recycled "lwd" parameter to polygon
Hello dear members of R-help and R-core mailing list, I am not sure if this request is a "ticket" that should be filled somewhere outside the mailing list. If so, I apologize for not doing and would like to know where I should have filled it. And to the subject matter: I would like to use a command like this: plot(c(1,8), 1:2, type="n") polygon(1:7, c(2,1,2,NA,2,1,2),
2009 Oct 02
1
suggest enhancement to segments and arrows to facilitate horizontal and vertical segments
I suggest a simple enhancement to segments() and arrows() to facilitate drawing horizontal and vertical segments -- set default values for the second x and y arguments equal to the first set. This is handy, especially when the expressions for coordinates are long. Compare: Segments: < function (x0, y0, x1 = x0, y1 = y0, col = par("fg"), lty = par("lty"), --- > function
2008 Feb 16
1
Evaluate function on a grid
I have a function in R^2, say f <- function(x,y) { ...skipped } I want to plot this function using contour, persp. wireframe, etc. I know that the function has a global minimum at (x0, y0) The naive approach is to evaluate the function on the outer product of two arrays, like this: sx <- c(seq(-3, x0, len = 100), seq(x0, 3, len = 100)[-1]) sy <- c(seq(-3, y0, len = 100), seq(y0, 3,
2010 May 03
3
how to rewrite this for loops in matrix form without loop
x0=rnorm(100) y0=rpois(100,3)+1 ind=as.data.frame(table(y0)) ind1=ind[,1] ind2=ind[,2] phi=NULL for (i in 1:length(ind2)){ phi[i]=sum(x0[y0==ind1[i]])/ind2[i] } [[alternative HTML version deleted]]
2006 Dec 02
1
Trouble passing arrays to C code
Hello, I'm having more trouble with interfacing with C code. I have a function in C that will return the result of its computation as 3 arrays. The signature of the function is as follows: void lorenz_run(double x0, double y0, double z0, double h, int steps, double *res_x, double *res_y, double *res_z) The function works, as I've tested it from within C itself and the results
2013 Nov 21
2
overlaying 2D grid on randomly distributed points
Hi, I have a cloud of randomly distributed points in 2-dimensional space and want to set up a grid, with a given grid-cell size, that minimizes the distance between my points and the grid nodes. Does anyone know of an R function or toolbox that somehow addresses this problem? This is a problem of optimizing the location of the grid, not a problem of deciding what should be the grid-cell size,
2017 Jun 19
1
arrows: no vectors for "code" and "angle" parameters
I was teaching new R users to make some fun graphs. I had some arrows examples worked up we came across a problem. The arrows function ignores 2nd and following elements of vectors given as code an angle. Would you please consider 1) allowing vectors for code and angle, or 2) returning an error or warning when user mistakenly supplies a vector for those parameters? When code like this is
2008 Nov 17
2
re sults from "do.call" function
Dear R users... I made this by help of one of R users. _________________________________________________________________ X=matrix(seq(1,4), 2 , 2) B=matrix(c(0.6,1.0,2.5,1.5) , 2 , 2) func <- function(i,y0,j) { y0*exp(X[i,]%*%B[,j]) } list1 <- expand.grid( i=c(1,2) , y0=c(1,2) , j=c(1,2) ) results <- do.call( func , list1 )
2011 Aug 08
1
problem in do.call function
Dear all, I am trying to use "do.call", but I don't think I totally understand this function. Here is an simple example. -------------------------------------------- > B <- matrix(c(.5,.1,.2,.3),2,2) > B [,1] [,2] [1,] 0.5 0.2 [2,] 0.1 0.3 > x <- c(.1,.2) > X <- cbind(1,x) > X x [1,] 1 0.1 [2,] 1 0.2 > > lt <-
2009 Dec 01
2
Starting estimates for nls Exponential Fit
Hello everyone, I have come across a bit of an odd problem: I am currently analysing data PCR reaction data of which part is behaving exponential. I would like to fit the exponential part to the following: y0 + alpha * E^t In which Y0 is the groundphase, alpha a fluorescence factor, E the efficiency of the reaction & t is time (in cycles) I can get this to work for most of my reactions,
2008 Apr 16
1
segments() with zero-length arguments (PR#11192)
Uwe Ligges suggested I post this on R-bugs as a wishlist item with a proposed patch. R considers zero-length arguments to segments() to be an error. I would like R to allow this and to return without an error. It occurs naturally in settings like valid <- c(FALSE, FALSE, FALSE) segments(x0[valid], y0[valid], x1[valid], y1[valid]) For what it may be worth, S-Plus does not consider