Skip to content
Prev 387776 / 398502 Next

[External] LHS random number generator

I don't know the LHS package.  I don't see it on CRAN as either LHS, or more likely, as lhs (lower case).
When you write back to the list, using plain text, not HTML, please state where the LHS package is located.

I do see several potential problems.

You use a function randomLHS without first loading the package with a call something like
library(LHS)


Your use of the c() function turns the numbers into characters.  There is no indication
that you want to increment in units of .01:
[1] "lmp"  "0.4"  "0.43"



Explicit use of seq doesn't get what you are looking for.  Numbers in R (and most computer
programs) are binary and the representation in only a few decimal places is rounded. Thus:
[1] 0.40000000000000002 0.41000000000000003 0.42000000000000004
[4] 0.42999999999999999


see FAQ 7.31 for discussion of number representations.
https://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f