This worked example, hoping to be helpful, has been requested after a (my)
further enquiry about array manipulation.
I was looking for a command that is equivalent to repmat() in matlab and
that could also be applied to array.
(for Matlab users)
The Matlal code was the following:
1)temp_u=zeros
This worked example, hoping to be helpful, has been requested after a (my)
further enquiry about array manipulation.
I was looking for a command that is equivalent to repmat() in matlab and
that could also be applied to array.
(for Matlab users)
The Matlal code was the following:
temp_u=zeros(d
You seem to be looking for 'aperm'.
There is a chapter in 'S Poetry' (available
on http://www.burns-stat.com) that talks
about working with higher dimensional
arrays. I don't think any changes need
to be made for R.
On 02/11/2011 16:16, Simone Salvadei wrote:
Hello,
I'm at the very beginning o
On Nov 2, 2011, at 12:16 PM, Simone Salvadei wrote:
Hello,
I'm at the very beginning of the learning process of this language.
Sorry in advance for the (possible but plausible) stupidity of my
question.
I would like to find a way to permute the DIMENSIONS of an array.
Something that sounds
Hello,
I'm at the very beginning of the learning process of this language.
Sorry in advance for the (possible but plausible) stupidity of my question.
I would like to find a way to permute the DIMENSIONS of an array.
Something that sounds like the function "permute()" in matlab.
Given an array C
-project.org
Subject: [R] array manipulation
Hello listeRs,
I'm trying to make a square radius around a given reference point. So
given the following array, how can I manipulate it so that
x0 <- array(1,dim=c(5,5))
x0
1 1 1 1 1
1 1 1 1 1
1 1 *1* 1 1
1 1 1 1 1
1 1 1 1 1
becomes
into
3
Hello listeRs,
I'm trying to make a square radius around a given reference point. So
given the following array, how can I manipulate it so that
x0 <- array(1,dim=c(5,5))
x0
1 1 1 1 1
1 1 1 1 1
1 1 *1* 1 1
1 1 1 1 1
1 1 1 1 1
becomes
into
3 3 3 3 3
3 2 2 2 3
3 2 *1* 2 3
3 2 2 2 3
3 3 3 3 3
On Feb 24, 3:57 pm, jdeisenberg wrote:
> Λεωνίδας Μπαντής wrote:
>
> > 1. Suppose I have a<-c(1:10) (or a<-array(c(1:10),dim=c(1,10)))
>
> > and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to
> > substitute alla elements that are <5 with 0 and >5 with 1.
>
> I think you
2009/2/23 Λεωνίδας Μπαντής :
>
> Hi there,
>
> I am pretty new to R. Actually I started using it yesterday. I have two
> questions:
>
> 1. Suppose I have a<-c(1:10) (or a<-array(c(1:10),dim=c(1,10)))
>
> and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to
> substitute alla
Λεωνίδας Μπαντής wrote:
>
> 1. Suppose I have a<-c(1:10) (or a<-array(c(1:10),dim=c(1,10)))
>
> and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to
> substitute alla elements that are <5 with 0 and >5 with 1.
>
I think you mean >=5, not > 5. In that case, try this:
Hi there,
I am pretty new to R. Actually I started using it yesterday. I have two
questions:
1. Suppose I have a<-c(1:10) (or a<-array(c(1:10),dim=c(1,10)))
and I want to end up with vector b=[0 0 0 0 0 1 1 1 1 1]. i.e. I want to
substitute alla elements that are <5 with 0 and >5 with
11 matches
Mail list logo