mcva
February 23, 2021, 2:17pm
1
I´m trying to append the result of a loop which produces a vector with different length (the model output). Unfortunatley cbind only works if the vectors have the same length. How can I solve this? Thank you.
d <- lapply(1:10, function(i) {model <- code
data.frame(model)})
df_total <- do.call(cbind, d)
transit <- head(long_vector, excess_rows)
parked <- tail(long_vector,excess_rows)
stow <- cbind(transit,short_vector)
arrive <- rbind(parked,stow)
Should work. See the FAQ: How to do a minimal reproducible example reprex
for beginners for what to do to attract more and better answers (I haven't reversed engineered an example to test my pcode.)
system
Closed
March 16, 2021, 8:03pm
3
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.