dears!
Summarizing my problem in a small example...
I want to append a row in data.frame using a list of variables with the same name of the data.frame columns, like this:
#createing a blank data.frame
df <- data.frame(matrix(ncol=3, nrow=0))
#naming the header
head <- c("col1", "col2", "col3")
# assigning header to data.frame
colnames(df) <- head
# creating three variables with the same name of header
col1 <- 1
col2 <- 2
col3 <- 3
#appending the row
rbind(df, list(col1, col2, col3))
The code runs, but the df continues blank. I would like a result like this for df:
col1 col2 col3
1 2 3
Help me with this rbind.