search for: par

Displaying 20 results from an estimated 1748 matches for "par".

Did you mean: part
2010 Jan 20
Error meaning
Hi r-users,   I have the following code to solve 4 simultaneous eqns with 4 unknowns using newton iteration method.  But I got the error message:   pars <- c(1.15, 40, 50, 0.78) newton.input2 <- function(pars) {  ## parameters to estimate      alp <- pars[1]    b1  <- pars[2]     b2  <- pars[3]    rho <- pars[4]   f1 <- pars[1]*pars[2] f2 <- pars[1]*(pars[1]+1)*pars[2]^2 f3 <- pars[1]*(pars[1]+1)*pars[3]^2 f4 <-...
2002 Feb 11
I am running 1.3.1 on a Windows (NT 4.0) machine. I''ve fit a nonlinear model intended to predict crop yield from nutrient information, and want to use the profile function. If I type say, profile( I get the following error message: "Error in prof$getProfile(): number of iterations exceeded maximum of 5.25515e-308" I used the profiler function to profile simparj,fm step by step, profiling one parameter at the time and calculating the profile t statistics. I''ve played...
2007 Nov 07
strwidth and strheight for rotated text
...ed strwidth and strheight to compute the size of the box which is plotted with rect: z <- rnorm(10) # horizontal text works plot(rnorm(10)) x1 <- 5 y1 <- 0 label <- "Label" cha <- paste(" ", label, " ", sep = "") xh <- strwidth(cha, cex = par("cex")) yh <- strheight(cha, cex = par("cex")) * 5/3 rect(x1 - xh/2, y1 - yh/2, x1 + xh/2, y1 + yh/2, col = "white") text(x1, y1, cha, cex = par("cex")) Now I would like to do the same with rotated text. I found two solutions: - modif...
2000 Dec 29
Is this a bug? Having cex!=1 before setting par(mai=) gives strange line spacings.
width <- 7 height <- 5 # create whatever device type # and have cex=1 before setting par(mai=) windows(width=width, height=height, rescale="R") oldmai <- par("mai") par(cex=1) par(mai=oldmai) par(usr=c(0,2,0,2)) par(cex=2) par1 <- par() text(1,1,"there is hardly anything i know for sure\nneither of the future nor of the past\nnor should i know...
2012 Aug 31
fitting lognormal censored data
..., there is now avalible pakage in R can help me in this, I had to write my own code using Newton Raphson method which requires first and second derivative of log likelihood but my problem after runing the code is the estimators were too high. with this email ,I provide simple example for estimation parameters for lognormal when we have only right censored data, and I tried to estimate the parameters using three methods, Surv pakage, optim function, and Newton Raphson calculation. For the Surv pakage and Optim function, I got similar results of estimation values to the true values, but for the New...
2017 Jul 26
axis() after image.plot() does not work except if points() is inserted between
Thanks... I agree that the problem was explained in the documentation but I can't find a way to have axis() working even manipulating par("plt") or with graphics.reset = TRUE: - adding graphics.reset=TRUE does not allow axis() to be shown; - I see that par()$plt is involved but it is the not sufficient to explain why axis() works because if it is changed by hand, axes are not shown. Thanks for the trick about range(). I...
2005 Dec 03
How to catch value
Dear R users: I have a problem about catch the value from function. I have following two functions (part): fbolus1 <- function() {......... par<-data.frame(Parameter=c("kel","Vd"),Initial=c(0)) check(par) .....} check<-function(par) { if (par[ ,2] <= 0){ cat("\nEnter again (y/n) ?\n\n") ans<-readline() if (ans == "n" ){ return...
2008 Oct 15
Lattice key title color
Dear R users, is there a way to define the color of the title for the legend in lattice? The help page on xyplot has a lot of details on key options just as the new book, but no mentioning of a color attribute for the title. Should I use ltext or is there any other way? Best wishes, Erik [[alternative HTML version deleted]] ______________________________________________
2012 Sep 13
list of funtions
...ant to do is construct a list of functions where form is already set. So in pseudocode fs[[1]](...) <- fitMicroProtein(form=0,...) fs[[2]](...) <- fitMicroProtein(form=1,...) . . . I''ve tried that and it doesn''t work. Here''s my code: Newton <- function(metaf,par,niter,dealwith_NA,...) { fs <- list() for(i in 0:(length(par)-1)) { fs[[i+1]] <- function(par) return(metaf(par,form=i,...)) } . . . and the problem is with the variable ''i''. If I use the debugger, I find that it is s...
2017 Jul 25
axis() after image.plot() does not work except if points() is inserted between
>>>>> Marc Girondot via R-help <r-help at> >>>>> on Mon, 24 Jul 2017 09:35:06 +0200 writes: > Thanks for the proposition. As you see bellow, par("usr") is the same > before and after the points() (the full code is bellow): > .... >> par("usr") > [1] -0.2500000 1.2500000 -0.1666667 1.1666667 >> # if you remove this points() function, axis will show nothing. >> &gt...
2007 Dec 27
warning on gamma option in par(args) or calling par(= new)?
Dear All, I have the following function tstpar <- function(n = 200, want.pdf = FALSE, pdfFileName = NULL){ oldpar <- par(no.readonly = TRUE) on.exit(par(oldpar)) steps <- seq(from = 1, to = 8, by = 1) h <- 10; w <- 6 if(want.pdf){pdf(file = pdfFileName, onefile = TRUE, paper = "letter", width...
2006 Apr 28
dear list, i have a problem using the par function. in one graphic device i want to have two plots so i tried to use par(mfror=c(1,2)). of course it worked out, but the height now is twice the length of the width for each single plot. what i actually wanted is something like par(mfrow=c(2,2)) where only the top (or bottom) two plots are d...
2010 Nov 21
solve nonlinear equation using BBsolve
Hi r-users, I would like to solve system of nonlinear equation using BBsolve function and below is my code.  I have 4 parameters and I have 4 eqns. mgf_gammasum <- function(p) { t  <- rep(NA, length(p)) mn <- 142.36 vr <- 9335.69 sk <- 0.8139635 kur <- 3.252591 rh  <- 0.896 # cumulants k1 <- p[1]*(p[2]+p[3]) k2 <- p[1]*(2*p[2]*p[3]*p[4] +p[2]^2+p[3]^2) k3 <- 2*p[1]*(p[2]+p[3])*(p[2]^2 +...
2017 Jul 24
axis() after image.plot() does not work except if points() is inserted between
Thanks for the proposition. As you see bellow, par("usr") is the same before and after the points() (the full code is bellow): .... > par("usr") [1] -0.2500000 1.2500000 -0.1666667 1.1666667 > # if you remove this points() function, axis will show nothing. > > points(1.5, 1.5, type="p") > p2 <...
2013 Jun 18
deSolve question
Dear All wonder if you could provide some insights on the following: currently I have this code which produces the expected results: require(deSolve) pars <- list(k = 0.08,v=15) intimes <- c(0,0.5,12) input <- c(800,0,0) forc <- approxfun(intimes, input, method="constant", rule=2) derivs <- function(t, state, pars) { inp <- forc(t) dy1 <- - pars$k * state[1] + inp/pars$v return(list(c(dy1))) } model <-...
2017 Jul 28
[FORGED] Re: axis() after image.plot() does not work except if points() is inserted between
Hi I believe this is a clipping bug in the 'graphics' package. A simpler version of the problem is this ... plot(1:10) mtext("margin-label", side=2, at=9, las=1, line=1, adj=0) par(mfg=c(1,1)) ## Only the text within the plot region is drawn mtext("margin-label", side=2, at=9, las=1, line=1, adj=0, col="red") I have committed a fix to the development version of R (r72982). Paul On 26/07/17 21:29, Marc Girondot via R-help wrote: > Thanks... I...
2012 Aug 15
question concerning par("plt") and par("mar")
Hello, I have a function that changes par("plt") to plot a colorkey, and upon returning resets the original value. Unfortunately this changes the size of the plots when I change the layout. A simplified example: par(mfrow = c(1, 1)) plt <- par("plt") # .... # change par(plt) and create c...
2000 Feb 02
Outer margin (oma) settings for pairs()
I propose the following small changes to pairs.default. The point is to allow control of the outer margin settings, so that there is for example room for legends. [Note also the issue re the setting of par()$usr on exit] ---------------------------------------------------------------- (1) Replace function (x, labels, panel = points, main = NULL, font.main = par("font.main"), cex.main = par("cex.main"), ...) with: function (x, labels, panel = points, main = NULL, font.main...
2011 May 11
mtext text size (cex) doesn't match plot
Hi, I am using mtext instead of the ylab argument in some plots because i want to move it away from the numbers in the axis. However, the text in the X axis, for example: par(mar=c(5, 5.5, 4, 2)); plot(data, main="plot name", xlab= ''X axis'', ylab="", font=2, cex.lab=1.5, font.lab=2, cex.main=1.8); mtext(''Y axis'', side=2, cex=1.5, line=4, font=2); This works fine, but if I then set par(mfrow=c...
2010 Aug 30
Putting legend *outside* plotting area
Is there a simple way to put a legend outside the plot area for a simple plot? I found... (at # Expand right side of clipping rect to make room for the legend *par(xpd=T, mar=par()$mar+c(0,0,0,4))* # Graph autos (transposing the matrix) using heat colors, # put 10% of the space between each bar, and make labels # smaller with horizontal y-axis labels barplot(*t*(autos_data), main="Autos", ylab="Total", col=*heat.colors(3), space=0.1, c...