search for: yv

Displaying 20 results from an estimated 82 matches for "yv".

Did you mean: yuv
2003 Aug 11
0
Designing and incorporating a digital filter
...It is:- /* Digital filter designed by mkfilter/mkshape/gencode A.J. Fisher Command line: /www/usr/fisher/helpers/mkfilter -Bu -Bp -o 5 -a 1.0000000000e-02 1.0000000000e-01 -Z 2.0000000000e-01 -l */ #define NZEROS 12 #define NPOLES 12 #define GAIN 1.548068051e+03 static float xv[NZEROS+1], yv[NPOLES+1]; static void filterloop() { for (;;) { xv[0] = xv[1]; xv[1] = xv[2]; xv[2] = xv[3]; xv[3] = xv[4]; xv[4] = xv[5]; xv[5] = xv[6]; xv[6] = xv[7]; xv[7] = xv[8]; xv[8] = xv[9]; xv[9] = xv[10]; xv[10] = xv[11]; xv[11] = xv[12]; xv[12] = `next input value' / GAIN;...
2008 Sep 30
1
Using sub to get captions in barplots
...The R Book, see below), the captions are split on more than 1 line. Is there a way to get the caption on a single line? Cheers, David y.bar.new = c(30, 15) se.ybar.new = c(2,3) error.bars(y.bar.new, se.ybar.new, c("Control (n=18)", "CKD (n=18)")) error.bars<-function(yv,z,nn){ xv<-barplot(yv,ylim=c(0,(max(yv)+max(z))),names=nn,ylab="Total five hour potassium excretion (mmol)", sub= "Figure 1B: Hour 1-5 potassium excretion") g=(max(xv)-min(xv))/50 for (i in 1:length(xv)) { lines(c(xv[i],xv[i]),c(yv[i]+z[i],yv[i]-z[i])) lines(c(xv[i]-g,xv[i]+g...
2008 Sep 06
2
Hopefully an easy error bar question
...this is split into two levels so i have males and females, so my graph basically has four bars on it. I know how to add eror bars for instance when there is only one level eg lookng at the diffrence between male and female lizards and tree height and have used the code: error.bars<-function(yv,z,nn) { xv<- barplot(yv,ylim=c(0,(max(yv)+max(z))),names=nn,ylab=deparse(substitute(yv) )) g=(max(xv)-min(xv))/50 for (i in 1:length(xv)) { lines(c(xv[i],xv[i]),c(yv[i]+z[i],yv[i]-z[i])) lines(c(xv[i]-g,xv[i]+g),c(yv[i]+z[i], yv[i]+z[i])) lines(c(xv[i]-g,xv[i]+g),c(yv[i]-z[i], yv[i]-z[i])) }}...
2017 Jan 03
0
[PATCH 1/5] builder: extract Yajl helper functions to yajl.ml
...ter (fun (k, _) -> k = key) (Array.to_list o) with - | [(k, v)] -> Some v - | [] -> None - | _ -> error (f_"more than value for the key '%s'") key) - | _ -> error (f_"the value of the key '%s' is not an object") key - -let object_find key yv = - match object_find_optional key yv with - | None -> error (f_"missing value for the key '%s'") key - | Some v -> v - -let object_get_string key yv = - match object_find key yv with - | Yajl_string s -> s - | _ -> error (f_"the value for the key '%s...
2018 Jan 30
2
Calculating angle of a polyline
Assuming your polyline is defined by two vectors, one for the x coordinates, one for the y coordinates, you can try the following library(NISTunits) polyangles <- function(xV,yV) { stopifnot( (length(xV)==length(yV)) && (length(xV) >= 3)) v <- function(i) { c( xV[i]-xV[i-1], yV[i]-yV[i-1])} vlen <- function(v) { sqrt(sum(v*v)) } lV <- rep(NA_real_,length(xV)) for ( i in 2:(length(xV)-1) ) lV[i] <- acos( sum(v(i)*v(i+1))/(vlen(v(i))*vle...
2009 Mar 11
4
error.bars
Hi, I'm trying to use the function "error.bars", but the program don't find it, and I dont't found any package with this function. Is there some another functin to draw barplots with error bars? Sueli Rodrigues Eng. Agr?noma - UNESP Mestranda - USP/ESALQ PPG-Solos e Nutri??o de Plantas Fones (19)93442981 (19)33719762
2018 Jan 30
0
Calculating angle of a polyline
I like to use complex numbers for 2-dimensional geometry. E.g., > polyAngles2 function (xV, yV) { stopifnot((length(xV) == length(yV)) && (length(xV) >= 3)) z <- complex(re = xV, im = yV) c(NA, diff(Arg(diff(z))), NA) # radians, positive is counter-clockwise } > x <- c(0:3) > y <- c(0,0,1,1) > polyAngles2(x,y) / pi * 180 [1] NA 45 -45 NA Bill Du...
2011 Oct 04
1
Rug plot curve reversal
Dear R-help Can anyone tell me why my curve appears the wrong way round on a rug plot? I am using the same code as on pg 596 of the Crawley R-book. mod<-glm(mort~logBd,binomial) par(mfrow=c(2,2)) xv<-seq(0,8,0.01) yv<-predict(mod,list(logBd=xv),type="response") plot(logBd,mort) lines(xv,yv) I've tried swapping xv and yv around but no luck. Thanks, Pete [[alternative HTML version deleted]]
2018 Aug 20
0
[PATCH 4/4] mltools: JSON: unify JSON_parser type with JSON.json_t.
...k, _) -> k = key) (Array.to_list o) with + | JSON.Dict fields -> + (match List.filter (fun (k, _) -> k = key) fields with | [(k, v)] -> Some v | [] -> None | _ -> error (f_"more than value for the key ‘%s’") key) @@ -46,27 +37,27 @@ let object_find key yv = let object_get_string key yv = match object_find key yv with - | JSON_parser_string s -> s + | JSON.String s -> s | _ -> error (f_"the value for the key ‘%s’ is not a string") key let object_find_object key yv = match object_find key yv with - | JSON_parser_ob...
2012 Jun 20
1
Problem with predict?
...hat I'm doing: head(mort) Time Density 0 2233333333 0 2100000000 0 1933333333 5 1900000000 5 1433333333 5 900000000 plot(Density~Time) This plots something that looks a lot like a decay rate mod<-lm(log(Density)~Time) xv<-seq(0,60,0.1) yv<-exp(predict(mod,list(time=xv))) lines(xv,yv) Everything seems to work fine until I try to plot the lines, but then I get the error message: Error in xy.coords(x, y) : 'x' and 'y' lengths differ Checking the lengths of x and y confirms that somehow the object yv is not using x...
2011 Feb 15
1
Passing Arguments in a function
...ibrary(nlrwr) # Build a model. decay.model <- nls(lift ~ SSexp(total.reach, y0, b), data = decay.data) # plot the model plot(decay.data[["total.reach"]], decay.data[["lift"]]) xv <- seq(min(decay.data[["lift"]]), max(decay.data[["total.reach"]]), 0.02) yv <- predict(decay.model, newdata = list(total.reach = xv)) lines(xv,yv) This works. If i try and wrap this in a function and pass the argument values i fail when i reach the "list(total.reach = xv)" i've tried various flavours or paste(), but again can't figure out where i am...
2018 Aug 22
3
[PATCH v2 0/2] mltools: JSON: unify JSON & JSON parser.
v2: - Added back the null value. - Reran the tests. Rich.
2011 May 26
2
Plot binomial regression line
Dear all, I am quite new with R and I have a problem with plotting a binomial regression line in a plot. This is what I type in: > model<-glm(Para~Size,binomial) > par(mfrow=c(1,1)) > xv<-seq(3.2,4.5,0.01) > yv<-predict(model,list(area=xv),type="response") > plot(Size,Para) > lines(xv,yv) The error message that I get is: > Error in xy.coords(x, y) : 'x' and 'y' lengths differ My txt-file is attached. Could someone please help me to find out what I did wrong. Thank...
2018 Aug 17
0
[PATCH v3 1/4] mltools: Rename Yajl module as JSON_parser and move to common/mltools.
...uilder_json_parser_tree_parse" let object_find_optional key = function - | Yajl_object o -> + | JSON_parser_object o -> (match List.filter (fun (k, _) -> k = key) (Array.to_list o) with | [(k, v)] -> Some v | [] -> None @@ -46,27 +46,27 @@ let object_find key yv = let object_get_string key yv = match object_find key yv with - | Yajl_string s -> s + | JSON_parser_string s -> s | _ -> error (f_"the value for the key ‘%s’ is not a string") key let object_find_object key yv = match object_find key yv with - | Yajl_object _...
2017 Jun 14
4
[FORGED] Re: draw stripes in a circle in R
...2 * pi/nv > angles <- seq(0, 2 * pi - angle.inc, by = angle.inc) > if (length(col) < length(radius)) > col <- rep(col, length.out = length(radius)) > for (circle in 1:length(radius)) { > xv <- cos(angles) * radius[circle] + x > yv <- sin(angles) * radius[circle] * ymult + y > polygon(xv, yv, border = border, col = col, lty = lty, density=density, angle=angle, > lwd = lwd) > } > invisible(list(x = xv, y = yv)) > } > > Now run your call to pdf with draw.circle2 inste...
2018 Aug 20
6
[PATCH 0/4] mltools: JSON unification
An evolution of: https://www.redhat.com/archives/libguestfs/2018-August/msg00155.html
2011 Nov 09
3
Help with tryCatch with a for loop
...pecified location: lmodel<-lm(abund~year, data=sub.ECDO) abline(lmodel$coefficients[1],lmodel$coefficients[2],lty=2) #To plot the polynomial model for the specified location: polymodel<-lm(abund~year+I(year^2), data=sub.ECDO) xv<-seq(min(sub.ECDO$year),max(sub.ECDO$year),0.1) yv<-predict(polymodel,list(year=xv)) lines(xv,yv) #To plot the logistic model #####tryCatch logis<-nls(abund~SSlogis(year,a,b,c),data=sub.ECDO) yv<-predict(logis,list(year=xv)) lines(xv,yv) #To find which model is the best fit: if ("logis" %in% ls()) { AIC.resu...
2017 Jun 14
0
draw stripes in a circle in R
...t;- getYmult() angle.inc <- 2 * pi/nv angles <- seq(0, 2 * pi - angle.inc, by = angle.inc) if (length(col) < length(radius)) col <- rep(col, length.out = length(radius)) for (circle in 1:length(radius)) { xv <- cos(angles) * radius[circle] + x yv <- sin(angles) * radius[circle] * ymult + y polygon(xv, yv, border = border, col = col, lty = lty, density=density, angle=angle, lwd = lwd) } invisible(list(x = xv, y = yv)) } Now run your call to pdf with draw.circle2 instead of draw.circle Best; David. >&gt...
2010 Feb 10
2
Total least squares linear regression
Dear all, After a thorough research, I still find myself unable to find a function that does linear regression of 2 vectors of data using the "total least squares", also called "orthogonal regression" (see : http://en.wikipedia.org/wiki/Total_least_squares) instead of the "ordinary least squares" method. Indeed, the "lm" function has a
2010 Sep 28
1
95% confidence intercal with glm
Hi I had to use a glm instead of my basic lm on some data due to unconstant variance. now, when I plot the model over the data, how can I easily get the 95% confidence interval that sormally coming from: > yv <- predict(modelVar,list(aveLength=xv),int="c") > matlines(xv,yv,lty=c(1,2,2)) There is no "interval" argument to pass to the predict function when using a glm, so I was wondering if I had to use an other function thanks -- View this message in context: http:...