Message-ID: <CA+vqiLHSZyPnb+Ky-ia=Y1OjwpQnoAw53R=ei+nmPJ20YGStSA@mail.gmail.com>
Date: 2013-02-24T12:26:06Z
From: Ista Zahn
Subject: filling an array
In-Reply-To: <CAGR4ry4=Hw99bbuLXHH4RNMG+XW+PR0aH4VkfDu4F6qPNX4N6Q@mail.gmail.com>
Hi,
The usual way is
I <- rep(c(0, v), each=10)
Best,
Ista
On Sat, Feb 23, 2013 at 10:56 PM, Jannetta Steyn <jannetta at henning.org> wrote:
> Hi All
>
> I'm just wondering if there is a quick way of filling a way with the
> following.
>
> I want to declare array I with a specific length and then alternatively
> fill it with 10 zeros and 10 specified values:
>
> v<- 14
> I <- c(0,length(t))
>
> But in stead of just filling I with 0 I want 10 zeros and then 10 fourteens
> (i.e. the value in v)
>
> Hope that makes sense.
>
> Regards
> Jannetta
>
> --
>
> ===================================
> Web site: http://www.jannetta.com
> Email: jannetta at henning.org
> ===================================
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.