search for: dimension

Displaying 20 results from an estimated 3690 matches for "dimension".

2007 Oct 08
7
belongs_to association doesn't work with _id set
Hello there, I''m developing an application which has models like this: class Vehicle < ActiveRecord::Base belongs_to :internal_dim, :class_name => "Dimension" def before_create() idim = Dimension.create self.internal_dim_id = idim.id #self.create_internal_dim # Doesn''t work end end class Dimension < ActiveRecord::Base has_one :vehicle end That is, creating the vehicle should create a dimension entr...
2013 Jun 07
4
matched samples, dataframe, panel data
I R-helpers #I have a data panel of thousands of firms, by year and industry and #one dummy variable that separates the firms in two categories: 1 if the firm have an auditor; 0 if not #and another variable the represents the firm dimension (total assets in thousand of euros) #I need to create two separated samples with the same number os firms where #one firm in the first have a corresponding firm in the second with the same #year, industry and dimension (the dimension doesn't need to be exactly the #same, it could vary in an in...
2017 Jul 14
3
Making 2 dimensional vector from the 3 dimensional one
Hi All, I want to make a 1 dimension vector from the first two dimensions of a 3 dimension array, so make a 2 dimension vector from a 3-dimension one, with "fusing" (making as.vector) the first two dimensions. It seems to be very easy, but I cannot find the solution, I mean it would very strange, that I would do taking the s...
2010 Apr 18
3
xtabs() of proportions, and naming a dimension (not a row)
Hi, xtabs() creates a table of counts. I want a table of proportions -- that is, I want to divide every vector (along a particular dimension) by its sum. The tiny example below does that. The call to xtabs() creates a matrix "A" with dimensions ("x1","x2","y"). I transform "A" using aperm() and aaply() to get the matrix "B". The problem: "B" has dimensions (<No...
2007 Dec 18
4
accessing dimension names
I have a matrix y: > dimnames(y) $x93 [1] "1" "2" $x94 [1] "0" "1" "2" .................. so on (there are other dimensions as well) I need to access a particular dimension, but a random mechanism tells me which dimension it would. So, sometimes I might need to access dimnames(y)$x93, some other time it would be dimnames(y)$x94.. and so on. Now let that random dimension be idx, then dimnames(y)$paste('x',idx...
2006 Jul 27
2
Vector extracted from a matrix. How can I specify dimensions in as.matrix?
...a matrix. Using simple vectors (no matrix involved) the transpose function works fine: simplevector <-matrix(1:3,3,1) tsimplevector <-t(simplevector) #transposed dim(simplevector) #3x1 matrix (vector) dim(tsimplevector)#1x3 PROBLEM: However, when the vector is extracted from a matrix, its dimension is NULL. In this case the transposed dimension is correct, but you'll see the next example, that if a row was extracted, the dimension would be wrong: initialmatrix <- matrix(1:9,3,3) extractedvector <-initialmatrix[,1] # extract first columm as vector textractedvector <-t(extracte...
2012 Aug 16
3
r data structures
hi, i'm trying to understand r data structures. i see that vectors, matrix, factors and arrays have a "dimension." there seems to be no mention of dimensionality anywhere for lists or dataframes. can i consider lists and frames to be of fixed dimension 2? thanks, jay s
2006 Oct 19
2
arraytake for extracting subarrays from multidimensional arrays
Hi, I recently encountered a problem with array subsetting and came up with a fix. Given an array of arbitrary dimensions, in which the number of dimensions is only known at runtime, I wanted to extract a subarray. The main issue with doing this is that in order to extract a subarray from an array of (say) 4 dimensions you usually specify something like this a.subarray <- a[,c(4,2),1:5,] However, if your code ne...
2017 Jun 01
5
Reversing one dimension of an array, in a generalized case
Hi All: I have been looking for an elegant way to do the following, but haven't found it, I have never had a good understanding of any of the "apply" functions. A simplified idea is I have an array, say: junk(5, 10, 3) where (5, 10, 3) give the dimension sizes, and I want to reverse the second dimension, so I could do: junk1 <- junk[, rev(seq_len(10), ] but what I am after is a general function that will do that where the array could be two, three or four dimensions, and I pass to the function which dimension I want to reverse, that is the fu...
2008 Mar 01
2
Newbie: Incorrect number of dimensions
....sub),50))*2 diff<- mt.rawp2adjp(two_side) all_differ<-diff[[1]][37211:10000,] all_differ #####list of differentially expressed genes########## > probe.names<- + all_differ[[2]][all_differ[[1]][,"BY"]<=0.01] Error in all_differ[[1]][, "BY"] : incorrect number of dimensions Hi, I am pretty new with R. What i am trying to do is to find all differentially express genes and list of differentially expressed genes. Am i doing something wrong? I keep getting incorrect number of dimensions. How do i find out the correct dimensions? thanks, Keizer -- View this message...
2003 Aug 24
2
setClass question
...have: setClass("matrix.diag.csr","matrix.csr") My understanding (shakey, as it is) is that if I now try to construct a matrix.diag.csr object the checking of it should be just like the checking for a matrix.csr object, but > new("matrix.csr",ra=1:3,ja=1:3,ia=1:4,dimension=as.integer(c(3,3))) An object of class "matrix.csr" Slot "ra": [1] 1 2 3 Slot "ja": [1] 1 2 3 Slot "ia": [1] 1 2 3 4 Slot "dimension": [1] 3 3 > new("matrix.diag.csr",ra=1:3,ja=1:3,ia=1:4,dimension=as.integer(c(3,3))) Error in valid...
2003 Oct 31
4
Array Dimension Names
I would like to reference array dimensions by name in an apply and a summary function. For example: apply(x, "workers", sum) Is there a better way to do this than creating a new attribute for the array and then creating new methods for apply and summary? I don't want to name the individual elements of each dimension (such...
2006 Apr 07
4
reading mpeg4 dimensions and flv dimension using ruby
Hey guyz, Well basically what i am trying to do is get ruby to read my video files in so that i can get the dimensions of the video and then place the dimension sizes in my view. The two formats i need to do this with are mpeg4 (h.264) and FLV. Is there anyway i can get rails to access the metadata of these formats and pull the dimensions from the metadata? Any help would be greatly appreciated. Thank you, --...
2016 Apr 24
2
How to take a multidimensional data set to higher dimensions using R?
Hi, I have a multidimensional data-set( multiple 'x' variables with a target variable). I want to take it to a higher dimensional space so that I can apply classification technique with ease . Is there a package in R which would allow me to take these data points from lower dimensional space to higher dimensions? so t...
2009 Jul 08
3
Suggestion: Dimension-sensitive attributes
Hi, I agree with Henrik that his suggestion to have "dimension vector attributes" working like dimnames (see below) would be an extremely useful infrastructure adittion to R. If this is not considered for R-core, I am happy to try to implement this in a package, as a new class. And possibly do the same thing for data frames. Should you have any comments,...
2008 May 02
2
mosaic plot of "vcd" package does not stretch with 2-dimension?
Hi, I like mosaic function of "vcd" package. I have played around it. I have found out that mosaic plot data table is 2-dimension does not stretch when you enlarge a mosaic plot. It is okay when data table is 3 or more dimension. The first one is of 3-dimension table case, and the second one is 2-dimension. With the first plot, you can drag window to enlarge a plot. With the second, I cannot. I have gone through the...
2013 Mar 09
1
get current plot dimensions?
Hi R users, I find par("pin") is kind of confusing (or maybe just me?). The manual said it will give " The current plot dimensions, ‘(width,height)’, in inches." The word "current" is the key here. I thought it would give the dimensions of the to-be plot, but it actually gives the dimension of the finished plot: > layout(matrix(c(1,2,3,4), nrow=2), width=c(1,3), height=c(1,3)) > par("pin") [1]...
2013 Jun 08
0
data
....table(file="real_data_cecilia.txt",sep="\t") dim(final3New) #[1] 5369??? 5 #Inside the split within split, dummy==1 for the first row.? For lists that have many rows, I selected the row with dummy==0 (from the rest) using the #condition that the absolute difference between the dimensions of those rows and the first row dimension was minimum (after I applied the first #constraint).? I guess you wanted to select only a pair of rows (dummy=0 and dummy=1) for each lists. fun1<- function(dat,percent,number){??? ??? lst1<- split(dat,list(dat$year,dat$industry)) ??? lst1New<-...
2008 Oct 01
3
cryptic error message: "Error in embed(y, lag) : wrong embedding dimension"
Dear R Users, I've been hit with a cryptic error message: "Error in embed(y, lag) : wrong embedding dimension" My configuration is: - R 2.7.2 - Windows XP Sp2 Google returns nothing for this. Could someone suggest what this might mean ? Thanks in advance, Tolga Generally, this communication is for informational purposes only and it is not intended as an offer or solicitation for the purchase or...
2012 Feb 13
3
mgcv: increasing basis dimension
hi Using a ts or tprs basis, I expected gcv to decrease when increasing the basis dimension, as I thought this would minimise gcv over a larger subspace. But gcv increased. Here's an example. thanks for any comments. greg #simulate some data set.seed(0) x1<-runif(500) x2<-rnorm(500) x3<-rpois(500,3) d<-runif(500) linp<--1+x1+0.5*x2+0.3*exp(-2*d)*sin(10*d)*x3 y<-rpo...