0

Looking to calculate the mean of Value by region for every Label and save this to a new dataframe. As I have a huge dataset I would need a loop - any help would be greatly appreciated.

structure(list(Label = structure(c(1L, 2L, 1L, 1L, 2L, 2L, 2L, 
1L), .Label = c("a", "b"), class = "factor"), Region = structure(c(3L, 
1L, 1L, 1L, 1L, 2L, 2L, 3L), .Label = c("EUR", "GLB", "UK"), class = "factor"), 
Value = c(-6, 17, 26, -37, 44, -22, 15, 12)), .Names = c("Label", 
"Region", "Value"), row.names = c(NA, -8L), class = "data.frame")
user8491385
  • 413
  • 1
  • 5
  • 17

0 Answers0