I have a dataframe and would like to add a new column where the values are vectors.
Is this possible in R?
Thanks,
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can store a list as part of a data frame, which is one way to have vector-valued entries. For example:
As an example of how this is actually used in R, a
POSIXltdate is actually a list with components giving the year, month, day, and so on. When you store such a date variable in a data frame, what is stored is a list of vectors.