search for: dim3

Displaying 18 results from an estimated 18 matches for "dim3".

Did you mean: dim
2012 Dec 10
3
equivalent of group command of the egen function in Stata
Dear R listers, I am trying to create a new variable that uniquely identifies groups of observations in a dataset. So far I couldn't figure out how to do this in R. In Stata I would simply type: egen newvar = group(dim1, dim2, dim3) Please, find below a quick example to show what I am dealing with: I have a dataset with 4 variables: var <- runif(50) ## a variable that I want to group dim1 <- factor(rep(1:3, length.out= 50), labels = c("x","y","z") ) ## 3 variables that should form the g...
2011 Aug 17
1
multinomRob - error message
...59316 D4 2182 9208 7288 10654 2951 5205 0.08227831 0.2591124 0.19605699 D5 6129 13909 12691 15560 3129 12551 0.10438878 0.2362780 0.23772964 D6 3027 13517 4702 17899 5299 5758 0.10507522 0.2034102 0.07564233 PLR05 UDC05 MCG05 dim1 dim2 dim3 D1 0.3006495 0.08555836 0.12254194 0.4327918 -0.37563170 0.23139759 D2 0.4879385 0.09903729 0.05058832 1.2723817 0.03128996 -0.10629471 D3 0.2296300 0.07822276 0.12785602 -0.8002237 -0.12194377 0.18147181 D4 0.3051325 0.06789533 0.08952449 0.4321835 0.11445829 0.24636903 D5 0.2811336 0.0662...
2010 Jan 20
1
Change an array into a dataset of four variables, dim1, dim2, dim3 and its elements
Hi, See my example below. a<-array(1:12,c(2,3,2)) > a , , 1 [,1] [,2] [,3] [1,] 1 3 5 [2,] 2 4 6 , , 2 [,1] [,2] [,3] [1,] 7 9 11 [2,] 8 10 12 I want to get a result something like dim1 dim2 dim3 elements 1 1 1 1 2 1 1 3 2 2 1 2 I tried the data.frame and expand.grid functions, but the results are not what i want. I think there must be an easy method to do it. Anybody can tell me that function or method? Thanks. ... -- ----...
2010 Nov 08
1
unknown dimensions for loglm
..., .02) d2.c2 <- rnorm(20, .09, .02) d3.c1 <- rnorm(20, .11, .02) d3.c2 <- rnorm(20, .11, .02) group1 <- cbind(1, d1.c1, d2.c1, d3.c1) group2 <- cbind(2, d1.c2, d2.c2, d3.c2) colnames(group1) <- colnames(group2) <- c("group", "dim1", "dim2", "dim3") combined <- rbind(group1, group2) combined[,2:4] <- combined[,2:4] > .1 ctables <- xtabs(~., data = combined) loglm(~group+dim1+dim2+dim3, data=ctables) Call: loglm(formula = ~group + dim1 + dim2 + dim3, data = ctables) Statistics: X^2 df P(> X^2) Li...
2012 Feb 25
5
which is the fastest way to make data.frame out of a three-dimensional array?
foo <- rnorm(30*34*12) dim(foo) <- c(30, 34, 12) I want to make a data.frame out of this three-dimensional array. Each dimension will be a variabel (column) in the data.frame. I know how this can be done in a very slow way using for loops, like this: x <- rep(seq(from = 1, to = 30), 34) y <- as.vector(sapply(1:34, function(x) {rep(x, 30)})) month <- as.vector(sapply(1:12,
2012 Dec 07
1
points3d and ordirgl
Hello all, I have been using the function ordirgl to plot 3D dynamic ordinations. The ordirgl function works just fine. IN fact, I was even able to write a function that allows me to identify points in the 3D plot: identify.rgl<-function(env_var,ord,dim1,dim2,dim3) { tmp<-select3d(button="left") tmp.keep<-tmp(ord[,dim1],ord[,dim2],ord[,dim3]) env_var[tmp.keep=="TRUE"] } where env_var = a variable to be identified (e.g. plot IDs as in > row.names(dataframe)) ord = ordination points or scores created using...
2004 Jul 16
1
labels for 3d Plots
High! How can I add variable labels (rownames for instance) to a plot created with ‚clouds’ ( clouds(dim3~dim1*dim2)) – package lattice? Thanks in advance! Martina Renninger [[alternative HTML version deleted]]
2012 Apr 05
0
Multi part problem...array manipulation and sampling
...where [,162,] != NA....this will create a ragged array where the number of counts per sitesurvey varies outdata (dim1 varies from 1,22...ragged, 162,56). Step 2) from the extracted list, I would like to randomly select n rows (say for example, 3) outdata (dim1=2 or 3 counts(samples), dim2=162, dim3=56) Step 3) I need to sum the values from the columns of dimension 1 from step 2 s outdata (dim1=1 (column sums), dim2=162, dim3=56) Not sure how clear I've explained this, but any suggestions would be really helpful. Most appreciatively: Brian Campbell -- View this mess...
2010 Dec 27
2
Finding indexes of minum and maximum elements of an array
Hello there I wish to get the "coordinates" of the minimum element of an array. For example, if the array were > H = array(c(8:5,1:4),dim=c(2,2,2)) > H , , 1 [,1] [,2] [1,] 8 6 [2,] 7 5 , , 2 [,1] [,2] [1,] 1 3 [2,] 2 4 then > min(H) [1] 1 and > max(H) [1] 8 Say "idx" were the function I'm looking for. Then, what
2003 Sep 25
1
apply on a 4D array
...0.8941212 0.7257939 0.5631331 0.5815922 h4 0.8487089 0.6284291 0.4226977 0.4107244 , , a1, w2................................ I thought it would be something along the lines of apply(4Darray, c(1,2,3), function(x) x*3Darray). But this returns the results in the form of 64rows by dim1 by dim2 by dim3. , , i4, a4 h1 h2 h3 h4 [1,] 8.05058486 6.881337e+00 5.579569e+00 3.940329195 [2,] 0.19306289 2.185652e-01 2.347175e-01 0.219540239 . . . [63,] 0.00000000 1.300468e-01 2.430320e-01 0.395577205 [64,] 0.00000000 0.000000e+00 1.191559e-02...
2006 Jun 02
2
basic array question
I have a large array and would like to extract from it the row and column indices just of values for which a particular boolean condition is true. I assume there's a simple way to do this, but I haven't figured it out yet. Any help would be appreciated. Tim
2010 Apr 22
3
using which to select range of values
Hi all, I would like to get the array index for a range of values, say 0 < x < 1.5. I'm wondering if there is an alternative for the following which I've done x0 <- rnorm(100) x1 <- ifelse(x0 > 0 & x0 < 1.5,"t","f") x2 <- which(x1=="t",arr.ind=TRUE) x0[x2] Thanks. -- Muhammad
2008 Sep 10
1
Return dimension index from array with n-dimensions
Hi, I have been dealing with some problems finding a fast way of getting to know in what dimension a specific value is located out of an array (like the 'which' function for a vector returns its position). Unable to find anything about this on the internet I wrote a function myself. Could you please comment if such a function already exists, and if not, please feel free to comment the
2003 Aug 20
0
Re: Re: Your application
...Names The appropriate PTC product name must be entered in the PRODUCT field in the email. Product Name ------------------- 3DPaint CADDS4x CADDS5 EXPLICIT CADDS5 PARAMETRIC CDRS CE/TOL DIM3 Division Mockup Division ProductView Electronic Services Expert Framework Extension Expert Moldbase Extension GPOST Granite Medusa Optegra Pro/CDM Pro/COLLABORATE -...
2003 Aug 20
0
Re: Re: That movie
...Names The appropriate PTC product name must be entered in the PRODUCT field in the email. Product Name ------------------- 3DPaint CADDS4x CADDS5 EXPLICIT CADDS5 PARAMETRIC CDRS CE/TOL DIM3 Division Mockup Division ProductView Electronic Services Expert Framework Extension Expert Moldbase Extension GPOST Granite Medusa Optegra Pro/CDM Pro/COLLABORATE -...
2003 Aug 20
0
Re: Re: Wicked screensaver
...Names The appropriate PTC product name must be entered in the PRODUCT field in the email. Product Name ------------------- 3DPaint CADDS4x CADDS5 EXPLICIT CADDS5 PARAMETRIC CDRS CE/TOL DIM3 Division Mockup Division ProductView Electronic Services Expert Framework Extension Expert Moldbase Extension GPOST Granite Medusa Optegra Pro/CDM Pro/COLLABORATE -...
2003 Jul 30
6
reverse array indexing
Hi, Suppose I have a multidimensional array: tmp <- array(1:8, c(2,2,2)) is there a function out there that, given a one-dimensional array index, will return the separate indices for each array dimension? for instance, tmp[8] is equivalent to tmp[2,2,2]. I'd like to derive the vector (2,2,2) from the index 8. thanks, Brad Buchsbaum
2012 Mar 25
2
avoiding for loops
I have data that looks like this: > df1 group id 1 red A 2 red B 3 red C 4 blue D 5 blue E 6 blue F I want a list of the groups containing vectors with the ids. I am avoiding subset(), as it is only recommended for interactive use. Here's what I have so far: df1 <- data.frame(group=c("red", "red", "red", "blue",