inst/tinytest/test_gh_issue_18.R

df <- data.frame(X = c(4L, 0L, 10L))
obj <- data.frame(X = 5L)

d1 <- gower_dist(obj, df)

df2 <- df[c(2,3,1),,drop=FALSE]
d2 <- gower_dist(obj, df2)

expect_equal(d1,d2[c(3,1,2)])

Try the gower package in your browser

Any scripts or data that you put into this service are public.

gower documentation built on Dec. 28, 2022, 2:03 a.m.