Combining vectors of unequal length into a data frame

前端 未结 3 1800
伪装坚强ぢ
伪装坚强ぢ 2020-12-06 06:04

I have a list of vectors which are time series of inequal length. My ultimate goal is to plot the time series in a ggplot2 graph. I guess I am better off first

3条回答
  •  失恋的感觉
    2020-12-06 06:41

    You can't. A data.frame() has to be rectangular; but recycling rules assures that the shorter vectors get expanded.

    So you may have a different error here -- the data that you want to rbind is not suitable, maybe ? -- but is hard to tell as you did not supply a reproducible example.

    Edit Given your update, you get precisely what you asked for: a list of names gets combined by rbind. If you want the underlying data to appear, you need to involve get() or another data accessor.

提交回复
热议问题