Skip to content

Commit

Permalink
Update 11_school_sampling.R
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmalla authored Feb 3, 2025
1 parent 116a182 commit 82eb297
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions scripts/11_school_sampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ class_sampling = function(numberOfclasses = 20, sampling_interval = 1.54, random
###
seq_numbers = seq(1, numberOfclasses, sampling_interval)

if(length(seq_numbers) > sample_size)
{
max_random = round(max(seq_numbers[1:(length(seq_numbers)-sample_size)], na.rm=T))
#if(length(seq_numbers) > sample_size)
#{
# max_random = round(max(seq_numbers[1:(length(seq_numbers)-sample_size)], na.rm=T))

} else{max_random = round(sampling_interval)}

if (is.null(random_start)) {
random_start = sample(1:max_random, 1)
}
#} else{max_random = round(sampling_interval)}
max_random = ceiling(sampling_interval)
random_start = sample(1:max_random, 1)

#if (is.null(random_start)) {
# random_start = sample(1:max_random, 1)
#}

random_prob = random_start/numberOfclasses

Expand Down

0 comments on commit 82eb297

Please sign in to comment.