Rotating the data to be in columns from top to bottom can be done like this.
library(lubridate)
#>
#> Attaching package: 'lubridate'
#> The following object is masked from 'package:base':
#>
#> date
library(tidyr)
df <- data.frame(Name = c("A", "B", "C", "D"),
Date1 = c(1,2,3,4),
Date2 = c(11,12,13,14),
Date3 = c(21,22,23,24),
Date4 = c(31,32,33,34))
df
#> Name Date1 Date2 Date3 Date4
#> 1 A 1 11 21 31
#> 2 B 2 12 22 32
#> 3 C 3 13 23 33
#> 4 D 4 14 24 34
df2 <- df %>% gather(key = "DATE", value = "Value", Date1:Date4)
df2
#> Name DATE Value
#> 1 A Date1 1
#> 2 B Date1 2
#> 3 C Date1 3
#> 4 D Date1 4
#> 5 A Date2 11
#> 6 B Date2 12
#> 7 C Date2 13
#> 8 D Date2 14
#> 9 A Date3 21
#> 10 B Date3 22
#> 11 C Date3 23
#> 12 D Date3 24
#> 13 A Date4 31
#> 14 B Date4 32
#> 15 C Date4 33
#> 16 D Date4 34
df3 <- df2 %>% spread(key = "Name", value = "Value")
df3
#> DATE A B C D
#> 1 Date1 1 2 3 4
#> 2 Date2 11 12 13 14
#> 3 Date3 21 22 23 24
#> 4 Date4 31 32 33 34
Created on 2019-05-06 by the reprex package (v0.2.1)
You can then process the data easily with map() from the purrr package