PROBLEM How can I concatenate the following lists into ONE LIST WITHOUT the unhelpful message "operator is invalid for atomic vectors"? Combine as a data frame?

EXAMPLE

Birth_Date      <- NULL
Birth_Date[1:3] <- c("01/17/1939","01/17/1949", "01/17/1959")
Later_Date      <- NULL
Later_Date[1:3] <- c("01/17/2009", NA, NA)
Names           <- NULL
Names[1:3]      <- c("Martha Smith", "John Doe", "Rufus Nobody")

#this does not work
family          <- c(Birth_Date, Later_Date, Names)
family$Birth_Date
Error in family$Birth_Date : $ operator is invalid for atomic vectors

FUNCTIONALLY DESIRED FROM THE FINAL COMBINED data frame
I would appreciate being able to do the following with the final list or data frame.
1. Be able to address names using $
2. Be able to change individual variables like the NA's to a proper date perhaps like

family$Later_Date[[3]] <- toString(format(Sys.time(),"%m/%d/%Y"), width=10)

Thanks, your help would is gratefully accepted,
Jim

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to