Displaying 20 results from an estimated 10000 matches similar to: "Converting data frame into multidimensional array"
2012 May 14
3
How to apply a function to a multidimensional array based on its indices
Hello. I have a 4 dimensional array and I want to fill in the slots with
values which are a function of the inputs. Through searching the forums here
I found that the function "outer" is helpful for 2x2 matrices but cannot be
applied to general multidimensional arrays. Is there anything which can
achieve, more efficiently than the following code, the job I want?
K <-
2012 Feb 01
1
Function to compute multi-response, multi-rater kappa?
I'm looking for a function in R that extends kappa to multiple raters when
there is more than one response per subject. For example, say a group of
doctors have to assign diseases to patients. Each patient will be assigned
one to many diseases, and the number of doctors assigning diseases to any
one patient will be two to many.
Here's an extremely simple example of the type of data I
2008 Nov 19
2
Multidimensional array with R
Hi there
I know, I'm sure you discussed this stuff 100 times, but I really have
a basic understanding problem, if and how do I create a
multidimensional array in R. I'm coming from MATLAB and there it's as
easy as you ever could imagine.
Ok, so, I want to have an array, where I can fill in data from a Excel
spreadsheet. The array should be addressed like this:
2006 Jul 17
1
multiplying multidimensional arrays (was: Re: [R] Manipulation involving arrays)
I am moving this to r-devel.
The problem and solution below posted on r-help could have been
a bit slicker if %*% worked with multidimensional arrays multiplying
them so that if the first arg is a multidimensional array it is mulitplied
along the last dimension (and first dimension for the second arg).
Then one could have written:
Tbar <- tarray %*% t(wt) / rep(wti, each = 9)
which is a bit
2019 Aug 02
2
[RFC] A new multidimensional array indexing intrinsic
On Aug 2, 2019, at 8:57 AM, Michael Kruse <llvmdev at meinersbur.de> wrote:
>> This is why I ask whether its makes sense to add this to LLVM IR: If you want HPC style loop transformations, I don’t think that LLVM IR itself will ever be great, even with this. This might make some narrow set of cases slightly better, but this is far from a solution, and isn’t contiguous with getting to
2011 Jan 19
1
combining matrices from a list into a multidimensional array
I get some results back from running an iterative analysis in the form of a list of matrices. What I would like to do with this list is combine it such that all the similar components get combined into a multidimensional array. If possible I'd like to put results[[1]]$resultmean and results[[2]]$resultmean into a 3x3x2 array, and also put results[[1]]$resultsd and results[[2]]$resultsd in a
2010 Oct 01
2
How to apply vector value function to a multidimensional array indexed by the remaining dimensions?
Hi,
I am looking for some generalization of colSums and rowSums for general
vector valued functions, and for arrays of more than 2 dimensions.
So as a concrete example, suppose I have a 3 dimensional array, given by x
= array(1:100,c(3,4,5)).
and I want to sum the 3rd index of x to obain a 3 by 4 matrix. Using rowSums
would return a vector of length 3 because it treats the last two indices as
2019 Aug 26
2
Multidimensional array indexing intrinsics
Linearized array addresses are an issue in loop nest transformation. To
alleviate the same, a multidimensional array indexing intrinsics have been
proposed recently in the llvmp-dev mailing list [1]. From the mailing
thread, it looks like there is a consensus on using intrinsics for
communicating dimensions [2].
While working with our own loop transformation framework, we did a similar
work on
2010 Nov 01
1
sqldf error only on Unix not Windows
Hello Group,
I am having trouble with the sqldf package on unix. The same code works fine on windows.
Silly Example script:
# Load the package
library(sqldf)
# Use the titanic data set
data(women)
colnames(women)
head(women)
sqldf('select height, count(*) from women where height is not null group by weight')
Unix Output and error:
bash-3.00$ R --vanilla <testR.R
2002 Apr 19
4
Multidimensional scaling
A student of mine wants to use R to do some nonmetric multidimensional
scaling. According to the R FAQ, there's a package called pcurve that
computes multidimensional scaling solutions, but I was not able to locate
it the contrib page (I am a Windows user with R version 1.4.1). Can
anyone tell me whether it is possible to do nonmetric multidimensional
scaling with R, and if so, how?
John
2019 Jul 25
0
[RFC] A new multidimensional array indexing intrinsic
It's also very common in Fortran.
-David
Michael Ferguson via llvm-dev <llvm-dev at lists.llvm.org> writes:
>> It seems that the main advantage of your proposal is that it would
>> allow for non-constant strides (i.e. variable length arrays) in
>> dimensions other than the first one. Do these appear frequently
>> enough in the programs
2011 Jan 20
2
Using a list as multidimensional indexer
Hello list.
Another 'puzzle' for which I don't have a clean solution.
Say I have a multidimensional object, e.g.:
Mm<-matrix(1:6, nrow=2, dimnames=list(c("a","b"), c("g","h","i")))
And on the other hand I have a list
Ind<-list("b","g")
This holds, for each dimension, an indexer for that dimension.
Now I would
2005 Nov 03
1
multidimensional integration not over a multidimensionalrectangle
Hi,
anyone knows about any functions in R can get multidimensional integration
not over a multidimensional rectangle (not adapt).
For example, I tried the following function f(x,n)=x^n/n!
phi.fun<-function(x,n)
{ if (n==1) {
x
}else{
integrate(phi.fun, lower=0, upper=x, n=n-1)$value
}
}
I could get f(4,2)=4^2/2!=8, but failed in f(4,3)=4^3/3! Thanks
Best,
Lynette
2019 Aug 01
2
[RFC] A new multidimensional array indexing intrinsic
On Jul 29, 2019, at 1:30 PM, Michael Kruse <llvmdev at meinersbur.de> wrote:
>> Have you been following what is happening on the MLIR side of the world? It directly supports multi-dimensional arrays with both value and buffer semantics (e.g. load, store, and DMA operations). It is specifically focused on solving these sorts of problems, and is the current proposed direction for the
2019 Jul 23
2
[RFC] A new multidimensional array indexing intrinsic
After having spoken to Johannes, I think we had a classic
misunderstanding on what "extending" means.
1.
The most obvious why for me was changing GEP to allow variable-sized
multi-dimensional arrays in the first argument, such as
%1 = getelementptr double, double* %ptr, inrange i64 %i, inrange i64 %j
(normally GEP would only allow a single index argument for a
pointer-typed base
2012 May 15
0
How to apply a function to a multidimensional array, based on its indices
Hello,
Your way is much better than to mess with the dim attribute, like I did.
But,
"If you can create a data.frame or matrix that has the indices"
Actually, it must be a matrix, indices can't be of type list.
A way to avoid loops/apply altogether, and much faster, is the one
creating K3
(K is the result from the op.)
n <- 20
t2 <- system.time({
K2 <-
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
> It seems that the main advantage of your proposal is that it would allow for non-constant strides (i.e. variable length arrays) in dimensions other than the first one. Do these appear frequently enough in the programs that you're interested in to be worth optimizing for?
Yes - at least in Chapel (which is one of the motivating languages)
these are very common.
In other words, typical
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,]
2008 Dec 23
1
Ordered Multidimensional Arrays
Hi,
I am inquiring as to what are the best practices with respect to storing and
manipulating ordered multi-dimensional arrays. For example, suppose I have
a sequence of time-varying covariance matrices of asset returns. The data
is ordered, but the ordering is not necessarily regular (e.g. daily data
omitting weekends and holidays, etc.). The data array is say, N x N x T.
For example, the
2019 Jul 22
2
[RFC] A new multidimensional array indexing intrinsic
We could also simply extend the existing inrange mechanism to
non-constantexpr GEPs. It would remove an inconsistency in the
semantics, be relatively straight forward, and solve the motivating
example.
(I didn't read the proposal in full, so there may be other examples it
doesn't solve.)
Philip
On 7/22/19 10:01 AM, Peter Collingbourne via llvm-dev wrote:
> The restrictions of