You can use the t.test() function in R to perform a t-test.
Here's an example:
# Create example data
group1 <- c(10, 15, 20, 25, 30)
group2 <- c(5, 10, 15, 20, 25)
# Perform a t-test
result <- t.test(group1, group2)
# Print the test result
print(result)
Output:
Welch Two Sample t-test
data: group1 and group2
t = 0, df = 7.87, p-value = 1
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
-6.36 6.36
sample estimates:
mean of x mean of y
20 15