Question: R code please The dplyr::fill() function takes a table column that has missing values and fills them with the most recent non-missing value. For this
The dplyr::fill() function takes a table column that has missing values and fills them with the most recent non-missing value. For this problem, we will create our own function to do the same. \#' Fill in missing values in a vector with the previous value. \#' eparm An input vector with missing values \#' eresult The input vector with NA values filled in. myFill (x){ \# Stuff in here! 3 The following function call should produce the following ouput test.vector C(A ', NA,NA,B ', 'C', NA,NA,NA) myFill(test. vector) [1] " A " "A" "A" "B" "C" "C" " C " " C
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
