See the FAQ: How to do a minimal reproducible example reprex
for beginners to get a more specific answer.
t.test
is not restricted to integer vectors: see the help(t.test)
example:
## Classical example: Student's sleep data
plot(extra ~ group, data = sleep)
## Traditional interface
with(sleep, t.test(extra[group == 1], extra[group == 2]))
#>
#> Welch Two Sample t-test
#>
#> data: extra[group == 1] and extra[group == 2]
#> t = -1.8608, df = 17.776, p-value = 0.07939
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#> -3.3654832 0.2054832
#> sample estimates:
#> mean of x mean of y
#> 0.75 2.33