How to analyase ranking data in R please?

I am still not quite sure what is the formal null hypothesis here. I have an example which may help you if that is the type of hypothesis you are trying to test. In my case I have 2 groups - A and B - could be different genders, age groups, etc. They have some data (responses) associated with them - could be answers, their blood pressure, anything really. I have simply drawn some random numbers with a different mean in my example. Now, my test here is that there is no difference in the mean response: H_0: \mu_A = \mu_B, where \mu is the population mean. You would then test this as follows:

set.seed(1)

responses_A <- rnorm(100, 0, 1) # Group A has a mean 0
responses_B <- rnorm(100, 1, 1) # Group B has a mean 1

t_test <- t.test(responses_A, responses_B)
t_test
#> 
#>  Welch Two Sample t-test
#> 
#> data:  responses_A and responses_B
#> t = -6.4983, df = 197.19, p-value = 6.492e-10
#> alternative hypothesis: true difference in means is not equal to 0
#> 95 percent confidence interval:
#>  -1.1122615 -0.5943477
#> sample estimates:
#> mean of x mean of y 
#> 0.1088874 0.9621919

The test statistic is t=-6.4983 with a p-value = 6.492e-10, so in this case as expected the means in groups A and B are statistically different (at any "normal" confidence level), i.e., the null hypothesis is rejected.