I know a few ways to get a single value out of a dataframe/tibble.
library(dplyr)
start_date <- tibble::tribble(
~StaffAbbrev, ~starting_date,
"Alexander", "2021-08-23",
"Cornelis", "2021-08-23",
"Sotirchos", "2021-08-23",
"Zhao", "2021-08-23",
"Park", "2022-02-14",
"Sarkar", "2022-04-04"
)
#Tidyverse way
Alexander_start_v1 <- start_date %>%
filter(StaffAbbrev == "Alexander") %>%
select(starting_date) %>%
unlist() %>%
unname()
#Base R way
Alexander_start_v2=start_date$starting_date[start_date$StaffAbbrev=="Alexander"]
Is shorthand/more elegant/one-liner tidyverse way to extract a single specific value out of a dataframe/tibble?