In an exercise, I have to create a data frame like this :
Name <- c("Sam","Frank","Amy")
Age <- c(22,25,26)
Weight <- c(150,165,120)
Sex <- c("M", "M", "F")
df <- data.frame (row.names = Name, Age, Weight, Sex)
So basically I create the columns and then a data frame based on these columns.
What if I have the following vectors and I'd like to create the same data frame ? Is there a way ?
Sam <- c(22,150, 'M')
Frank <- c(25, 165, 'M')
Amy <- c(26, 120, 'F')
Thanks