I would like to create a table that contains the row position of missing values from an original data frame. This would essentially take the first table as input and create the table below that one.
I know that I can use apply in order to create a list with this row position but I am struggling to then take that list and make a dataframe.
# Minimum working example
# Create dataset
data0 <- data.frame("A" = c(NA,NA,1,1), "B"= c(1,NA,1,1),"C"= c("john","john",NA,NA),"D"= c("john","john","john","john"))
# Create list of all rows containing missing values for a particular column then print as dataframe
list1<-apply(is.na(data0), 2, which)
> print(list1)
$A
[1] 1 2
$B
[1] 2
$C
[1] 3 4
$D
integer(0)
# Turn list1 to a data.frame leading to answer
