I'm fairly new to R, I feel like this is a basic question but I haven't been able to fix it.
I have the following code, where events_b an empty dataframe with the same headers as events, and cuts is a vector of POSIXct values.
events_b <- events[0,]
events_b <- rbind(events_b,
c(event$id[1], event$start[1], cut[1]),
c(eventos$id[1], cut[1], as.POSIXct(event$start[1]))
However, when I do this, the headers from events_b (originally from events) are replaced with what looks like the column vector (ex, instead of "id", I'm getting "c..001....002" as a column header)
Is there a way of keeping the column headers? I'm going to put this code inside a loop, so the rbind will keep adding rows to events_b, but it's important for it to start out empty.