[R] Creating a sequence from two samples with several constraints (frequency and repeats)

R. Michael Weylandt michael.weylandt at gmail.com
Sat Nov 5 00:56:04 CET 2011


I believe the permute package is set up to generate restricted permutations.

Michael

On Fri, Nov 4, 2011 at 4:59 PM, Jeremy Wang <wang0501 at umn.edu> wrote:
> I'm attempting to create a sequence for an experiment and am hoping I can
> use R to create it. It has several constraints:
>
> (1) It is made up of two sequences (red and green) that have 4 different
> repeating triplets (e.g. T1=ABC T2=DEF T3=GHI JKL)
> (2) Each sequence has the following constraints: (a) there cannot be
> repeating triplets (e.g. T1 T1), (b) there cannot be repeating triplet
> pairs (e.g. T1 T2 T1 T2)
> (3) Triplets occur with the following frequency: T1=20, T2=23, T3=26, T4=36
> (same for red and green sequences)
> (4) Red and green sequences are then interleaved, such that you never get
> more than 6 in a row of one color.
>
> (For those that are interested, I'm trying to replicate Turke-Browne,
> Junge, & Scholl, 2005, *JEP*, but with frequency manipulations to the
> triplets)
>
> Thanks in advance for any help.
>
>        [[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.
>



More information about the R-help mailing list