Hi everyone,
I've converted a table to something that is data frame-ish, but the structure is a tad wonky. The structure can be seen via dput below:
structure(c(39L, 50L, 1L, 1L, 0L, 298L, 167L, 440L, 220L, 146L,
347L, 704L, 1390L, 1743L, 2050L, 3077L, 4862L, 2700L, 7994L,
8049L, 8873L, 10265L, 10351L, 9377L, 8919L, 8902L, 4546L, 8L,
7L, 0L, 0L, 0L, 32L, 12L, 19L, 19L, 99L, 134L, 206L, 254L, 345L,
323L, 399L, 485L, 271L), dim = c(9L, 5L), dimnames = structure(list(
c("2013", "2014", "2015", "2016", "2017", "2018", "2019",
"2020", "2021"), c("c", "C", "NO VALUE", "p", "P")), names = c("",
"")), class = "table")
When I run this, the first row consists of : [nothing], c, C, NO VALUE, p, and P. Under the column without a header is [nothing], and under the rest are numbers. What I'd like to do is add a column header that says "year" to where there is currently nothing, and then make the first row of the remaining 5 columns into headers.
Is it possible to do this easily?
Thanks!