If I understand your question correctly. The code below should help. It is helpful with questions to add a small example data set, and your desired output. 
This answer uses the dplyr package
library(dplyr)
Example data:
data <- tibble(state = c("florida", "florida", "florida", 
                      "new_york", "new_york", "new_york"),
               year = c(1990, 1990, 1992, 1992, 1992, 1994), 
               income = c(19, 13, 45, 34, 66, 34))
To produce:
# A tibble: 6 x 3
  state     year income
  <chr>    <dbl>  <dbl>
1 florida   1990     19
2 florida   1990     13
3 florida   1992     45
4 new_york  1992     34
5 new_york  1992     66
6 new_york  1994     34
Code to summarise data (using dplyr package)
data %>%
  group_by(state, year) %>%
  summarise(
    mean_income = mean(income)
  )
Produces this output:
# A tibble: 4 x 3
# Groups:   state [?]
  state     year mean_income
  <chr>    <dbl>       <dbl>
1 florida   1990          16
2 florida   1992          45
3 new_york  1992          50
4 new_york  1994          34