barnyard_ghg <- read.csv('https://usda-ree-ars.github.io/SEAStats/R_boot_camp/datasets/barnyard_ghg.csv')
One way to do this would be glimpse(barnyard_ghg)
and
table(barnyard_ghg$Surface)
.
barnyard_ghg %>%
filter(Temp > 10) %>%
group_by(Surface) %>%
summarize(mean_CO2 = mean(CO2_mgC), mean_CH4 = mean(CH4_mgC), mean_NH3 = mean(NH3_ugN), mean_N2O = mean(N2O_ugN)) %>%
arrange(mean_CO2)
One way is:
pivot_longer(relig_income, cols = -religion)
or if you want to give your own names to the newly created columns,
pivot_longer(relig_income, cols = -religion, names_to = 'income', values_to = 'individuals')