var() is not equal to sd()^2 in R Mathematically, it is evident that var = sd^2 (or var^0.5 = sd), but R seems to answer TRUE for the latter and FALSE for the former.
To my knowledge, both var() and sd() function use n-1 for degree of freedom.
What would be the problem?
data <- c(20, 20, 30, 20, 16, 13, 20)

var(data)^0.5 == sd(data)
var(data) == sd(data)^2


Correct to 14 decimal points, it's a floating point number issue:
options(digits = 20)
> var(data)
[1] 27.476190476190474499
sd(data)^2
[1] 27.476190476190470946

