Challenge 10 Solutions

challenge_10
purrr
Author

Moira Chiong

Published

July 6, 2023

Mutate

y1_p25_earnings<- as.numeric(pseo_ma_SANDBOX$y1_p25_earnings)
y1_p50_earnings<- as.numeric(pseo_ma_SANDBOX$y1_p50_earnings)
y1_p75_earnings<- as.numeric(pseo_ma_SANDBOX$y1_p75_earnings)

df1 <-data.frame(y1_p25_earnings, y1_p50_earnings, y1_p75_earnings)

Purrr Function

map_dbl(list(df1$y1_p25_earnings, df1$y1_p50_earnings, df1$y1_p75_earnings),mean,na.rm=T)
[1] 30412.00 41256.48 53811.20