jeudi 15 avril 2021

drawing a value from a vector r

After removing the values from the vector from 1 to 100 I have the following vector:

 w
 [1]  2  5 13 23 24 39 41 47 48 51 52 58 61 62 70 71 72 90

I am now trying to draw values from this vector with the sample function

    for(x in roznica)
{
  
  if(licznik_2 != licznik_1 )
  {
    
    roznica_proces_2 <- sample(1:w, roznica)
  } else {
    roznica_proces_2 <- NA
  } 
}

I tried various combinations with the sample




Aucun commentaire:

Enregistrer un commentaire