In the exercise, I need to create such a data frame:
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 the data frame based on these columns.
What if I have the following vectors and would like to create the same data frame? Is there any way?
Sam <- c(22,150, 'M')
Frank <- c(25, 165, 'M')
Amy <- c(26, 120, 'F')
thank
source
share