Skip to content

Instantly share code, notes, and snippets.

@felixlindemann
Created January 10, 2014 12:54
Show Gist options
  • Save felixlindemann/8351456 to your computer and use it in GitHub Desktop.
Save felixlindemann/8351456 to your computer and use it in GitHub Desktop.
Get.Reliabilitätssample
get.ReliabilitätsSample<-function(n , min , max , seed ){
set.seed(seed) # Wähle eine bestimmte Zufallszahlenliste aus --> Für Reproduzierbarkeit
x<-sample(min:max, n) # Ziehe eine Stichproben von n Elementen
return (x[order(x)]) # gib eine sortierte Liste zurück
}
n <- 30
min <- 1
max <- 576
seed <- 0
get.ReliabilitätsSample(n,max,min,seed)
# Ergebnisse
# 23 39 57 58 60 64 101 144 145 175 190 201 216 220 248 298 361
# 363 364 365 367 424 429 459 460 461 477 507 542 569
max <- 584
get.ReliabilitätsSample(n,max,min,seed)
# 5 16 23 39 58 61 65 102 146 178 192 204 219 223 252 302 366
# 368 369 370 372 430 435 465 466 468 484 514 549 577
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment