Hi there!
I have the following dataset that I am trying to reduce to a single row by taking the mean of all the depths. When I try to use summarise()
it gives me an error:
Error: Problem with `summarise()` input `..2`.
x Input `..2` must be a vector, not a function.
i Input `..2` is `mean`.
What I want it to look like is a dataframe with a single row and two columns: the SITE_ID and the MEAN_DEPTH_M.
Here's the dataset:
secchi <- structure(list(SITE_ID = c("GBA20-10501", "GBA20-10501", "GBA20-10501",
"GBA20-10501", "GBA20-10501", "GBA20-10501"), DEPTH_M = c("2.3",
"2.0", "2.2", "2.0", "2.2", "2.0")), row.names = 4:9, class = "data.frame")
I tried this:
secchi %>% summarise(DEPTH_M, mean, na.rm=T)
Can anyone help me figure this out?
Thanks so much!