search for: cartesian

Displaying 20 results from an estimated 99 matches for "cartesian".

2009 Nov 21
1
How to make a cartesian pairlist from a vector?
Hi, I'm looking for a function that will take a list of columns or data.frame and corvert it to cartesian pairlist. For example for this data.frame (see below), I'd like to get a list of all possible pairs: > sound cs rs ns 7 5 2 4 5 4 6 3 1 8 4 1 6 4 2 6 7 1 2 2 5 9 2 5 how can I get this? > mylist ((cs,rs), (cs,ns), (rs,ns)) This list con...
2010 Aug 18
1
Plot in cartesian plane
Hi all, I'm trying to plot this two curves in a single cartesian plane, but when I plot the first one, the plot appears with no negative "y" value. When I plot the second curve, it almost does not apear in the graph. I was trying the plot.window but with no success. Can someone help me with this? If possible, I'd like to plot this curves in a pe...
2004 Sep 10
1
Efficient Cartesian product of data.frames
Hello List, I am looking for efficient code to produce the Cartesian product of two or more data.frames. I'd like to be able to do this without resorting to looping. I have searched the FAQ, web, etc without luck. That being said, the help page for merge says that the function can produce what I'm looking for if the by vectors are of zero length. Would s...
2012 Dec 31
2
code to convert 3D geographical coordinates to Cartesian?
Is there packaged code to convert geographical coordinates (e.g., longitude, latitude, elevation) to Cartesian coordinates in 3-space? I can see how to do this using 1. a spherical-to-Cartesian conversion like pracma::sph2cart(tpr) http://cran.r-project.org/web/packages/pracma/ 2. a geographical-to-spherical conversion. This seems to involve (in roughly increasing order of difficulty or error-prone-n...
2008 Aug 19
4
spatial probit/logit for prediction
Hello all, I am wondering if there is a way to do a spatial error probit/logit model in R? I can't seem to find it in any of the packages. I can do it in MATLAB with Gibbs sampling, but would like to confirm the results. Ideally I would like to use this model to predict probability of parcel conversion in a future time period. This seems especially difficult in a binary outcome model
2008 Dec 05
1
Cartesian Product Of Character Vectors
Hi all (I'm sure this question has been asked before, but I cant find it). If I have two character vectors: > x <- c("aaa","bbb","ccc") > y <- c("1","2","3") How can I get the cartesian product of the string values? > expand.grid(x,y) Gives me a data frame with separate columns...however, I cant seem to get *apply to paste the column values together. Thanks Rory Rory Winston RBS Global Banking & Markets 280 Bishopsgate, London, EC2M 4RB Office: +44 20 7085 4476 *****...
2009 Nov 21
0
How to make a cartesian pairlist?
Hi, I'd like to make a pairwise comparison of a data.frame and I'm looking for a function that will take a list of columns or data.frame and corvert it to cartesian pairlist. For example for this data.frame (see below), I'd like to get a list of all possible pairs: > sound cs rs ns 7 5 2 4 5 4 6 3 1 8 4 1 6 4 2 6 7 1 2 2 5 9 2 5 how can I get this? > mylist ((cs,rs), (cs,ns), (rs,ns)) This list contains a set of...
2010 Jul 07
0
HELP - four.nines.cartesian.probability.grid
...line= setting. (Try it: Cut and paste the code, then resize the screen plot to be wider.) Is there another way to do what I'm trying to do? I'm using R version 2.11.1 (2010-05-31), running on an HP 64 bit Windows 7 machine. Thanks ############################################ four.nines.cartesian.probability.grid <- function (X.data, x.title = "X", y.title = "Theoretical Normal CDF", X.start, X.end) { probs <- c(0.0001, 0.0003, 0.001, 0.002, 0.005, 0.01, 0.02, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 0.95, 0.98, 0.99, 0.995, 0.998, 0.999, 0.9997,...
2002 Nov 08
0
Polar plot, circular plot (angular data): II
...t.rad = function (x, twop = 2 * pi) { for (i in 1:length(x)) { while (x[i] < 0) x[i] <- x[i] + twop while (x[i] >= twop) x[i] <- x[i] - twop } return(x) }, fit.rad2 = function (th) pp$fit.rad(pp$theta.zero + (!pp$theta.clw) * th - (pp$theta.clw) * th), cartesian = function (r, th) { return(cbind(r * cos(th), r * sin(th))) }, basis = function () { if (is.null(pp$rupper)) pp$rpretty <<- pretty(0:ceiling(max(pp$r))) if (is.numeric(pp$rupper)) pp$rpretty <<- pretty(0:pp$rupper) if (is.numeric(pp$grid.circle.pos)...
2012 May 03
1
Creating a point pattern with cartesian co-ordinates
...125 349.156 -236.411 349.531 -252.794 350.503 -92.074 350.79 -116.177 350.953 -177.364 354.308 -123.398 354.417 -237.45 355.424 -197.235 358.092 -164.202 361.405 -240.484 363.009 -213.804 364.806 -243.099 -- View this message in context: http://r.789695.n4.nabble.com/Creating-a-point-pattern-with-cartesian-co-ordinates-tp4606343.html Sent from the R help mailing list archive at Nabble.com.
1999 May 06
1
x,y vs row,column
I think my problems are coused by a fundamental R incompatibility in how matrices are stored and the usual way of specifying Cartesian coordinates. When I do data<-read.table("~/r/rt/data/unif/6cbcif2d.out",header=TRUE) x<-unique(data$lag1) y<-unique(data$lag2) z<-matrix(data$cif2d,length(y),length(x)) This z matrix is printed apparently correctly from a Cartesian point of view > z [,1] [,2] [,3] [1...
2017 Jun 25
2
Writing my 3D plot function
...circles X,Y,Z with a good example being the image belowhttps://www.mathworks.com/help/examples/antenna/win64/xxpolarpattern_helix.png So for X axis my input is a 2D matrix [360,2] including a single measurement per each polar coordinate. The first thing I tried was to turn my polar coordinates to cartesian ones by writing two simple functions. This works so far and I was able to print three simple circles on 3d spaceb but the problem now are the legends I need to put that remain on cartesian coordinates. As you can see from the code below all circles should have radius 1 (in terms of simplicity) but...
2011 Apr 08
1
asking about contour plot with R
...look at that function you'll see it's very useful! But I have a problem with it and James is trying to help me (but also asked me to seek for more help) I hope you can help me (don't worry if you can't): Using "draw.contour" I get the contour but I want to place it in a cartesian-coordinate system where x = "Componente 1" range between -1 y 1 and y = "Componente 2" range between 0 and 3, regardless of xrange or yrange. Of course, xrange and yrange are important to obtain an adequate contour plot but I want to see that contour in the cartesian coordinate...
2017 Jun 25
0
Writing my 3D plot function
...od example being the >image >belowhttps://www.mathworks.com/help/examples/antenna/win64/xxpolarpattern_helix.png > >So for X axis my input is a 2D matrix [360,2] including a single >measurement per each polar coordinate. The first thing I tried was to >turn my polar coordinates to cartesian ones by writing two simple >functions. This works so far and I was able to print three simple >circles on 3d spaceb but the problem now are the legends I need to put >that remain on cartesian coordinates. As you can see from the code >below all circles should have radius 1 (in terms of...
2008 Apr 12
3
Matrix Indexing
...s (1,1),(2,2),(3,3), or another arbitrary diagonal (upper or lower), is there any way I can use a vector to do this? So if I want a diagonal of size 3, I could create a vector like x <- c(0:2) and then pick out a[1+x,1+x]? Currently, using a vector in this way gives me a sub-matrix, as I get the cartesian product of the indexes (which is to be expected, as I guess I am misusing the vector notion here). Anyone know how to do this? Cheers Rory [[alternative HTML version deleted]]
2002 Oct 17
0
Polar plot, circular plot (angular data)
....lab)) || (is.character(text.lab) & pi2.lab) || (pi2.lab & is.numeric(num.lab))) print("More than one type of angular labels was requested.") } theta2 <- fit.rad(theta.zero + (!theta.clw) * theta - (theta.clw) * theta) cartesian.rt <- cbind(r * cos(theta2), r * sin(theta2)) if (method == 1) { if (is.null(overlay) || overlay == 2) drawgrid() points(cartesian.rt[, 1], cartesian.rt[, 2], col = lp.col, pch = points.pch, cex = points.cex) } if (method == 2) { if (...
2006 Sep 15
1
Table manipulation question
I have a table: C1 RowName1 3 RowName2 2 and another table: C2 RowName1 5.6 RowName1a 4.3 RowName2 NA I want to join join the tables with matching rows: C1 C2 RowName1 3 5.6 RowName2 2 NA I'm thinking of something like:
2012 Oct 05
2
Test for Random Points on a Sphere
Dear All, I implemented an algorithm for (uniform) random rotations. In order to test it, I can apply it to a unit vector (0,0,1) in Cartesian coordinates. The result is supposed to be a set of random, uniformly distributed, points on a sphere (not the point of the algorithm, but a way to test it). This is what the points look like when I plot them, but other then eyeballing them, can anyone suggest a test to ensure that I am really...
2007 Oct 30
2
calculate spatial distance
Hi, I have a set of locations defined by longitude and latitude (in degrees), and want to calculate the spatial (or geographic) distance among all locations. I did not find such a function in the spatial-related packages. (I *cannot* use 'dist', as I have geographic, not cartesian coordinates). thanks! Robert Robert Ptacnik Norwegian Institute for Water Research (NIVA) Gaustadall?en 21 NO-0349 Oslo mobile +47 982 277 81 FON NIVA +47 22 18 51 00 FAX +47 22 18 52 00 --------------------------------------------------------------------------------------------------------...
2013 Mar 05
2
Function completely locks up my computer if the input is too big
Dear r-help, Somewhere in my innocuous function to rotate an object in Cartesian space I've created a monster that completely locks up my computer (requires a hard reset every time). I don't know if this is useful description to anyone - the mouse still responds, but not the keyboard and not windows explorer. The script only does this when the input matrix is large, an...