I am trying to create a data frame and have created list first before transferring into data frame. I did not use vector as I have the impression that I need to list out the individual levels stored in a variable? Using Titanic data. This is the scripts that I used. The result show 6 rows of data when i run head(df2)? I manage to view full data set when I run head(m2). Which part of the scripts that I need to change?
m2 <- list(Name = lum$Name,Age = lum$Age,Sex = lum$Sex )
head(m2)
df2 <- data.frame(m2$Name,m2$Age,m2$Sex,stringsAsFactors = FALSE)
head(df2)
Thank you very much!