search for: xpos

Displaying 20 results from an estimated 74 matches for "xpos".

Did you mean: pos
1998 Nov 28
1
No subject
...- c("H", "T") for(j in 1:trials) { plot(xpoints, ypoints, type = "n", xlab = "", ylab = "", axes = F, main = "Galton's Quincunx") points(x = xy[, 1], y = xy[, 2], pch = 5, col = 1) marble.path <- sample(HT, 25, replace = T) xpos <- 13 points(xpos, ypos[25], pch = 16, col = 8) for(i in 1:24) { if(marble.path[i] == "H") xpos <- xpos + 1 else xpos <- xpos - 1 if(xpos > 25) xpos <- 25 if(xpos < 0) xpos <- 0 points(xpos, ypos[25 - i], pch = 16, col = 8) } xheight...
2009 May 25
3
Interpolating variables within (RODBC library) SQL statements for MySQL
...to_ZIPCODE Database with holds records for German ZIP Code <--> Gauss-Krueger Coordinate System ) and want this to be selected and computed individually row by row as follows: library(RODBC) channel <- odbcConnect("database") pos_to_zip <- sqlQuery(channel, "select YPOS, XPOS FROM POSITION_to_ZIPCODE;") my_row <- pos_to_zip[1,] # get the first element (change with next ones afterwards) ypos <-my_row[1] # get the first y-position xpos <-my_row[2] # get the first X-Position So far, so good: SQL Select works and everybody is fine, but thi...
2002 Apr 10
0
FoxPro Regressions - followup from Feb
...e input window, and I entered (with the mouse) the window from the top, clicked in a couple different spots, and exited through the top. 001E0216 S WM_SETCURSOR hwnd:001E0216 nHittest:HTCLIENT wMouseMsg:WM_MOUSEMOVE 001E0216 R WM_SETCURSOR fHaltProcessing:False 001E0216 P WM_MOUSEMOVE fwKeys:0000 xPos:64 yPos:9 001E0216 S WM_NCHITTEST xPos:427 yPos:369 001E0216 R WM_NCHITTEST nHittest:HTCLIENT 001E0216 S WM_NCHITTEST xPos:427 yPos:369 001E0216 R WM_NCHITTEST nHittest:HTCLIENT 001E0216 S WM_NCHITTEST xPos:428 yPos:369 001E0216 R WM_NCHITTEST nHittest:HTCLIENT 001E0216 S WM_SETCURSOR hwnd:001E0216...
2009 Jul 09
1
Creating and Using Objects in R
...x-component and a y-component. All `rthetapoint' objects are lists > with an r-component and a theta-component. > > Now, suppose we want to get the x-position from either type of object. > This can easily be achieved through generic functions. We define the > generic function |xpos| as follows. > > xpos <- function(x, ...) > UseMethod("xpos") > > > Now we can define methods: > > xpos.xypoint <- function(x) x$x > xpos.rthetapoint <- function(x) x$r * cos(x$theta) > > > The user simply calls th...
1999 Oct 08
1
floor(NaN) problem fixed in massdist.c (PR#291)
...became NaN after this statement. So I looked at src/appl/masdist.c with a debugger. The bug is caused by floor(). On Alpha/Linux, floot(NaN) returns 0. x[i] in the following code is the list passed from the above statement in density(). The array x contains a couple of NaN. When x[i] is NaN, xpos become NaN. Then ix = floor(xpos) returns an unexpected result. On linux/i386, ix become -2147483648 when xpos = NaN(0x80000000007a2). However ix become 0 on Linux/Alpha when xpos=NaN. When xpos = NaN, it shouldn't go into the following "if" statement. But it goes inside on Alpha/L...
2005 Oct 28
2
line vector plots
Hi, I'm looking for the way to make vector plot over a time line. This plot, similar to the "feather plot" in Matlab, is a line in which every thick (a time value) one vector is drawn with its length proportional to one variable (wind speed, for example) and its direction to another (wind direction, for example). Any ideas? Thanks, EKS -- ---------------------------- Eduardo
2010 Dec 02
4
2D Random walk
I've wrote some code to simulate a random walk in 2 dimensions on a lattice. Basically I want to add something in to make it plot it point by point so you can see what is going on. Heres my code for the random walk in 2d RW2D<-function(N) { i<-0 xdir<-0 ydir<-0 xpos<-vector() xpos[1]<-xdir ypos<-vector() ypos[1]<-ydir for (i in 1:N-1) { r<-runif(1) if(r<=0.25) {xdir<-xdir+1} if(r>0.25 && r<=0.5) {xdir<-xdir-1} if(r>0.5 && r<=0.75) {ydir<-ydir +1} if(r>0.75) {ydir<-ydir-1}...
2009 Aug 27
2
setting par(srt) according to plot aspect ratio
...if the plot region is short and wide or tall and narrow. I can't find a par() component containing the plot aspect ratio. It will be for png() or postscript() output, if that matters. f <- function(x) x g <- function(x) 2*x (f_angle <- atan(1)*180/pi) (g_angle <- atan(2)*180/pi) xpos <- 0.2 plot(f) plot(g,add=TRUE) par(srt=f_angle) text(xpos,f(xpos),label="y=x",pos=3) par(srt=g_angle) text(xpos,g(xpos),label="y=2x",pos=3) -- Levi Waldron post-doctoral fellow Jurisica Lab, Ontario Cancer Institute Division of Signaling Biology TMDT 9-304D 101 College St...
2002 Aug 23
1
Legends and Fonts
Hello. Is it possible to set specify the font used by legend()? I would like to specify a fixed-width font so that I can line up parts of vertically stacked curve labels. For example, it would be nice if I could align the names, ages, and weights in the following three curve labels: Bob age=7 weight=100 Alexander age=13 weight=150 Susan age=20 weight=130 Is there perhaps a clever
2012 Oct 23
4
Changing radii line type in radial plots
Hello all, Is it possible to change the radii line type in radial plots? I wasn't able to find anything online. Thanks, Bern -- View this message in context: http://r.789695.n4.nabble.com/Changing-radii-line-type-in-radial-plots-tp4647238.html Sent from the R help mailing list archive at Nabble.com.
2008 Aug 09
1
Converting nested "for" loops to an "apply" function(s)
...iendly Beginners' R Course? by Toby Marthews (ZIP, 2007-03-01)") to an "apply" function(s). The relevant code is: distances=c(51,65,175,196,197,125,10,56) #distances of 8 houses from the town centre in m bearings=c(10,8,210,25,74,128,235,335) #bearings of the houses in degrees xpos=distances*sin(bearings*pi/180) #in sin and cos the argument MUST be in radians ypos=distances*cos(bearings*pi/180) numpoints=length(distances) nnd=rep(sqrt(2*400*400),times=numpoints) #start with the maximum possible distance for (i in 1:numpoints) { for (j in 1:numpoints) { if (i!=j) {...
2009 Mar 24
1
segfault when running heatmap()
...ing heatmap(). The sessionInfo() follows. Browse[1]> debug: op <- par(no.readonly = TRUE) Browse[1]> *** caught segfault *** address 0x103c93d53, cause 'memory not mapped' Traceback: 1: function (display = "", width, height, pointsize, gamma, bg, canvas, fonts, xpos, ypos, title, type, antialias) { if (display == "" && .Platform$GUI == "AQUA" && is.na(Sys.getenv("DISPLAY", NA))) Sys.setenv(DISPLAY = ":0") new <- list() if (!missing(display)) new$display <- display if (!missing(...
2000 Jul 28
4
Language element manipulation
...using `$'. Here is my (non-working) code: do.graph <- function (meas) { fn <- paste("a", meas, ".dat", sep='') themeas <- read.table(fn, header=F) ameas <- as.name(paste("a", meas, sep='')) names(themeas) <- c("xpos", paste("a", meas, sep='')) meassum <- summary(themeas$ameas[themeas$xpos==1]) ... } So, when this function is called with the argument ``infl'' the second column will be named ``ainfl''. In the last line I want to extract the column called ``ainf...
2013 Feb 14
12
[PATCH v7 0/5] xen: ARM HDLCD video driver
Hi all, these are the remaining unapplied patches of the ARM HDLCD patch series. Changes in v7: - rebased on b61ed421d2c85b5b106c63f2c14f8aa162b282f0; - turn more printk and panic into early_printk and early_panic. Changes in v6: - rebased on 77d3a1db3196b1b5864469f8d3f41d496800c795; - remove useless initializations to NULL in lfb_init; - more compact checks in lfb_init. Changes in v5: - move
2002 Mar 14
1
gif, jpeg and png image files reader AND tcltk image
Hi all, Roger Peng and Jason Turner's suggestion with ImageMagick seem to be the simplest "dirty" way to get the problem solved. But I ran into yet another interesting but quite round-about way to solve the problem (partially). Through tcltk package, one can read in the gif image with > x <- tkcmd("image", "create", "photo", file=mypic.gif)
2012 Feb 02
1
Draw vertical line segments between pairs of points
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20120202/9218c644/attachment.pl>
2001 Nov 20
2
quiver plot help
...efined on a grid. I have a matrix of x-components of velocity and a matrix of y-components and I want to see the overall flow pattern. (I work with 2D fluid mechanics problems). My first-stab function is below: quiver <- function(u,v,scale=1) # first stab at matlab's quiver in R { xpos <- col(u) ypos <- max(row(u))-row(u) speed <- sqrt(u*u+v*v) maxspeed <- max(speed) u <- u*scale/maxspeed v <- v*scale/maxspeed matplot(xpos,ypos,type="p",cex=0) arrows(xpos,ypos,xpos+u,ypos+v,length=0.05) } Thus, for example u <- ma...
2003 Aug 15
0
Re: [R} stars graphs
...",xlab="",ylab="",...) { maxlength<-1.1*max(lengths) if(missing(radial.range)) radial.range<-range(radial.pos) plot(c(-maxlength,maxlength),c(-maxlength,maxlength),type="n",axes=FALSE, main=main,xlab=xlab,ylab=ylab,...) # get the vector of x positions xpos<-cos(radial.pos)*lengths # get the vector of y positions ypos<-sin(radial.pos)*lengths segments(0,0,xpos,ypos) if(missing(labels)) labels<-as.character(radial.pos) if(missing(label.pos)) { xpos<-cos(radial.pos)*maxlength ypos<-sin(radial.pos)*maxlength } else { xpos<-...
2003 Aug 13
1
stars graphs
Hi listers, A few days ago I posted a question about the use of the stars function on selected lines of a frame. Thanks to two helpers, a closer look at the scale argument allowed to partially solve the problem. Yet I still have a problem with stars. Allow me to explain what I intend to do (sorry for my poor English and the long post): I want to graph an activity index of a fish during the day
2005 Jun 14
0
Plotting quiver vector tensor arrows 2d field data
...a quiver function in the archives. Is this the best solution or are there other tools I missed? quiver<- function(u,v,scale=1,length=0.05) # first stab at matlab's quiver in R # from http://tolstoy.newcastle.edu.au/R/help/01c/2711.html # Robin Hankin Tue 20 Nov 2001 - 13:10:28 EST { xpos <- col(u) ypos <- max(row(u))-row(u) speed <- sqrt(u*u+v*v) maxspeed <- max(speed) u <- u*scale/maxspeed v <- v*scale/maxspeed matplot(xpos,ypos,type="p",cex=0) arrows(xpos,ypos,xpos+u,ypos+v,length=length*min(par.uin())) } par.uin <-...