I would like to add a row to an exist df df. the newrow contain the data as below, where V2=nv.
My problem is as nv is character(0), how can I put it in as empty or NA? Is it a good way to bind it together?
I tried rbind(df,newrow, stringsAsFactors=FALSE) as well as df%>% add_row() but could not get it to work. could anyone show me how to do this in both way, if it is possible? Thanks.
df<- structure(list(ID = "S12",
Sheet = "Reproductive",
TEST = "Y",
V1 = NA_character_,
V2 = NA_character_),
class = "data.frame", row.names = c(NA, -1L))
nv <- character(0)
newrow<- nr<- list(ID ="S13",
Sheet="Test",
TEST= "N",
V2= nv,
V1= "removed")