Is this what you mean?
library(tidyverse)
library(xmrr)
df <- data.frame(stringsAsFactors=FALSE,
Year = c(2001, 2001, 2002, 2002, 2003, 2003, 2001, 2001, 2002, 2002, 2003, 2003),
Category = c("CatA", "CatB", "CatA", "CatA", "CatB", "CatB", "CatA", "CatB", "CatA", "CatA", "CatB", "CatB"),
Value = c(17, 32, 13, 12, 11, 15, 17, 32, 13, 12, 11, 15)
)
df %>%
group_nest(Category) %>%
pull(data) %>%
setNames(nm = unique(df$Category)) %>%
map_dfr(~xmr(., measure = "Value"), .id = "Category")
#> # A tibble: 12 x 9
#> Category Year Value Order `Central Line` `Moving Range`
#> <chr> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 CatA 2001 17 1 14.4 NA
#> 2 CatA 2002 13 2 14.4 4
#> 3 CatA 2002 12 3 14.4 1
#> 4 CatA 2001 17 4 14.4 5
#> 5 CatA 2002 13 5 14.4 4
#> 6 CatA 2002 12 6 14.4 1
#> 7 CatB 2001 32 1 20.2 NA
#> 8 CatB 2003 11 2 20.2 21
#> 9 CatB 2003 15 3 20.2 4
#> 10 CatB 2001 32 4 20.2 17
#> 11 CatB 2003 11 5 20.2 21
#> 12 CatB 2003 15 6 20.2 4
#> # … with 3 more variables: `Average Moving Range` <dbl>, `Lower Natural
#> # Process Limit` <dbl>, `Upper Natural Process Limit` <dbl>
Created on 2019-08-26 by the reprex package (v0.3.0)