Warning: Unknown or uninitialised column

I had datframe (pls see image)


and here my code

data1 <- lien2 %>% dplyr::filter(Age <=10)

cilogimmunity <- function(data1, ...) {
GMC = sum(data1$Immunity, na.rm = TRUE)
meanGMC = mean(data1$Immunity, na.rm = TRUE)
dplyr::tibble(
GMC = GMC,
meanGMC = meanGMC
)
}

cilogimmunity(trial)

This is result:
Warning: Unknown or uninitialised column: Immunity.
Warning: Unknown or uninitialised column: Immunity.
Warning in mean.default(data1$Immunity, na.rm = TRUE) :
argument is not numeric or logical: returning NA

Pls help me to slove this problems

Hello. If you could provide a reproducible example , that would allow us to better assist you.