mardi 1 novembre 2022

Creating matrix with values 1-4 in a random placement with limitations

I have an experiment where we are going to plant 4 different bushes in two different sized square plantings (8x8 bushes and 12x12 bushes) and we want their placement in the plantings to be randomized. I thought of trying to create a matrix in R for this purpose, since it's the software I'm used to. The issue is that the randomization has to follow a few limitations, and I’m not that experienced in creating matrices. The limitations are:

  • There has to be one of each species in each corner of the planting.
  • The two outer rows in the square has to contain an equal amount of each species.
  • The inner 4x4 quadrant in the square has to contain an equal amount of each species.
  • Plants of the same species can’t be planted next each other, but if they are placed on the diagonal of each other it’s fine. I hope the issue is clear, otherwise ask!



Aucun commentaire:

Enregistrer un commentaire