Skip to content
Prev 332969 / 398503 Next

repeating values in an index two by two

Hi,

first off, thanks for the suggestion.  I managed to solve it by doing:

IND = rep(c(T,T,F,F), 5)
X = rep(NA, 20)
X[IND] = 1:10
X[!IND] = 1:10

which avoids any function -- I think mapply, apply etc call a for loop internally, which I'd rather avoid.

BW

F
On 11 Nov 2013, at 12:35, andrija djurovic <djandrija at gmail.com> wrote:

            
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 881 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131111/094d9112/attachment.bin>