I have a dataframe in R where the first column represents the client IDs and the other columns are daily dates. For example
id <- seq(1:4)
qqqq141101 <- c(500, 0, 78, 10)
qqqq141102 <- c(500, 0, 78, 10)
frame <- data.frame(id, qqqq141101 , qqqq141102)
frame
I want to make a panel where I would have two dates for each client with corresponding values. Like this
id <- c(1,1,2,2,3,3,4,4)
day <- as.Date(c('2014-11-01', '2014-11-02', '2014-11-01', '2014-11-02','2014-11-01', '2014-11-02','2014-11-01', '2014-11-02'))
value <- c(500,500, 0, 0, 78, 78, 10, 10)
frame <- data.frame(id, day , value)
frame
My actual data consists of over 400 clients and over 100 day variables. I would very much appreciate any help.