If your list is called list_df
and numeric vector as vec
we can use Map
as :
list_df[names(vec)] <- Map(function(x, y) transform(x, response = response * y),
list_df[names(vec)], vec)
list_df
#$E9
# time response
#1 0.0 0.000000
#2 0.2 0.008267
#3 0.4 0.014169
#4 0.6 0.008451
#5 0.8 0.012589
#6 1.0 0.010974
#$F12
# time response
#1 0.0 0.000000
#2 0.2 0.007272
#3 0.4 0.008930
#4 0.6 0.007641
#5 0.8 0.008128
#6 1.0 0.007029
#$H1
# time response
#1 0.0 0.000000
#2 0.2 0.001551
#3 0.4 -0.004554
#4 0.6 0.003939
#5 0.8 0.003066
#6 1.0 -0.003191
data
list_df <- list(E9 = structure(list(time = c(0, 0.2, 0.4, 0.6, 0.8, 1),
response = c(0, 0.00826733, 0.01416873, 0.00845066, 0.01258872,
0.01097368)), class = "data.frame", row.names = c(NA, -6L
)), F12 = structure(list(time = c(0, 0.2, 0.4, 0.6, 0.8, 1),
response = c(0, 0.00703381, 0.00863728, 0.00739067, 0.00786157,
0.00679848)), class = "data.frame", row.names = c(NA, -6L
)), H1 = structure(list(time = c(0, 0.2, 0.4, 0.6, 0.8, 1), response = c(0,
0.00142469, -0.00418229, 0.00361758, 0.00281592, -0.00293035)),
class = "data.frame", row.names = c(NA, -6L)))
vec <- c(F12 = 1.033911, H1= 1.088928)