Suppose I have a tibble such as
t <- tibble(
x = c("a", "b", "c"),
y = c("d", "e", "f"),
z = c("g", "h", "i")
)
and I would like to find the minimum value over all values in all columns. What's the best way to do this within the Tidyverse mindset?
If I try min(t), I get the error
Error in FUN(X[[i]], ...) :
only defined on a data frame with all numeric-alike variables
The only ways I've found to do this so far involve extracting out the individual vectors and finding the min over those. For example, t_min <- min(c(t$x, t$y, t$z)) gives "a". This works, but it doesn't extend well to many columns.
Note: assume that the "min" function gives the desired result when applied to the string data.