Hello All and thanks in advance for any advice. I have a data frame with rows corresponding radio-collared animals (see sample data below). There is a start date (DATESTART), and end date (DATEEND), and the number of days on air (DAYSONAIR). What I would like to do is add a column called DATE to so that each row ID has a row for every day that the radio collar was on the air while copying all other data. For example ID 1001 would expand into 48 rows beginning with 4/17/91 and ending with 6/4/91. all other values would remain the same for each new rowUnfortunately I have not gotten anywhere with my attempts
Thank you!! ID GRID FOOD WB1 WB2 S A DRUG FREQ DATESTART DATECOLLAR DATEEND DAYSONAIR 1001 1 0 319 999 F A I 1482 4/17/91 4/17/91 6/4/91 48.00 1002 1 0 659 671 M A C 1408 4/17/91 4/17/91 6/25/91 69.00 1003 1 0 325 662 F A I 0769 4/17/91 4/17/91 6/4/93 779.00 1004 1 0 322 655 F A C 1561 4/18/91 4/18/91 5/27/91 39.00 93 1005 1 0 654 899 M A I 1288 4/18/91 4/18/91 5/27/91 39.00 94 1006 1 0 301 651 M A C 1593 4/18/91 4/18/91 7/11/91 84.00 95 1007 1 0 349 669 F A I 1521 4/18/91 4/18/91 11/2/91 198.00 [[alternative HTML version deleted]] ______________________________________________ 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.