I'm trying to make a data frame to then create a boxplot from. The data frame should contain 3 vectors of varying sizes. Let's say the data is currently in a$data, b$data and c$data, and are of lengths 7, 50, 200.
Here is a simplified version of my code, where the cbind step errors:
# create initial df
df <- data.frame()
# set column names
colnames(df) <- c("a", "b", "c")
# bind original data to new data frame:
df <- cbind(df, a$data, b$data, c$data)
# draw boxplot
boxplot(df)


df <- data.framecreates a function exactly equal to functiondata.frame. In R, this is the same asx <- 1; y <- x. The objectsxandyare nowidentical(). See whatidentical(df, data.frame)returns. Can you post the output ofdput(head(a$data))?dfhere would be a function, not a data object. (Perhaps I'm being too literal with your sample data.) Further, you cannotcbindframes of different numbers of rows ... okay, you sometimes can get away with it, but if it doesn't warn or error, you should be concerned (and more careful).c(7.8192479, 7.910274, 7.51289579, 7.189279, 7.5897185, 7.14218948)data.framecan't "contain [...] vectors of varying sizes". But lists can, e.g.l = list(x = rnorm(5, 2), y = rnorm(10, 3), z = rnorm(20, 1)). Andboxplothappily eats lists: ;boxplot(l).