R error: cannot coerce type ‘closure’ to vector of type ‘double’

Change:

sd.norm = sd(sample)/sqrt(n)

to:

sd.norm = sd(the.sample)/sqrt(n)

You are trying to use the function sample (a closure) as a number (double)

Leave a Comment