For reasons not relevant, let's assume I want to use rbind like so:
df.new = rbind(df.old, c(1, 2, 1, 1)
BUT, the issue is that df.new
has 5 columns, not 4. I want to leave the last field blank by design. Is this possible using rbind
?
For reasons not relevant, let's assume I want to use rbind like so:
df.new = rbind(df.old, c(1, 2, 1, 1)
BUT, the issue is that df.new
has 5 columns, not 4. I want to leave the last field blank by design. Is this possible using rbind
?
Use NA
as a placeholder in the columns you want to leave blank:
df.new = rbind(df.old, c(1, 2, 1, 1, NA))