Insert list of vectors to multiple tables in R -


i have list of 12 tables. same. 1 of tables :

$x2015_kvish_1_10t kvish keta maslul yom nefah status                date 1       1   10      1   2  1346     na 2015-06-15 00:00:00 2       1   10      1   2   788     na 2015-06-15 01:00:00 3       1   10      1   2   626     na 2015-06-15 02:00:00 4       1   10      1   2   652     na 2015-06-15 03:00:00 5       1   10      1   2   597     na 2015-06-15 04:00:00 6       1   10      1   2   798     na 2015-06-15 05:00:00 7       1   10      1   2  2344     na 2015-06-15 06:00:00 8       1   10      1   2  3617     na 2015-06-15 07:00:00 9       1   10      1   2  3669     na 2015-06-15 08:00:00 10      1   10      1   2  2873     na 2015-06-15 09:00:00 11      1   10      1   2  2926     na 2015-06-15 10:00:00 12      1   10      1   2  2928     na 2015-06-15 11:00:00 13      1   10      1   2  3681     na 2015-06-15 12:00:00 14      1   10      1   2  4158     na 2015-06-15 13:00:00  ....... 168 rows in total 

and have list of 12 vectors. each vector contains 7 values. name of list 'mean_values' this:

> mean_values $x2005_kvish_1_10t           b        c        d        e        f        g  3496.917 3480.167 3351.917 3382.500 3464.000 2859.417 2348.500   $x2006_kvish_1_10t           b        c        d        e        f        g  3439.625 3496.000 3502.875 3546.917 3519.250 2895.167 2333.208   $x2007_kvish_1_10t           b        c        d        e        f        g  3326.667 3363.208 3350.708 3466.250 3501.417 2829.083 2345.292   $x2008_kvish_1_10t           b        c        d        e        f        g  3440.000 3558.250 3439.167 3562.000 3605.875 2711.958 2276.208   $x2009_kvish_1_10t           b        c        d        e        f        g  3334.333 3213.917 3233.250 3281.292 3418.583 2727.000 2138.500   $x2010_kvish_1_10t           b        c        d        e        f        g  3233.667 3183.792 3354.458 3323.000 3527.875 2793.500 2232.542   $x2011_kvish_1_10t           b        c        d        e        f        g  2747.125 2749.750 2795.750 2755.792 2766.625 2220.000 1687.958   $x2012_kvish_1_10t null  $x2013_kvish_1_10t           b        c        d        e        f        g  3421.667 3181.083 3276.583 3419.708 3461.708 2806.708 2139.333   $x2014_kvish_1_10t           b        c        d        e        f        g  2910.958 2745.917 2811.708 2886.208 2963.542 2459.292 1865.000   $x2015_kvish_1_10t           b        c        d        e        f        g  2869.708 2868.250 2919.292 2808.417 2438.167 1841.875 2929.083   $x2016_kvish_1_10t           b        c        d        e        f        g  2848.375 2818.042 2927.833 2976.042 3061.083 2584.667 1884.292  

what want add each vector each table new column, because have 168 rows in each table represent full week, need attach first value of each vector first row in each table , second value of each vector 25'th row in each table , third value of each vector 49'th row in each table , on vectors' values. rest of values in new column na's.

if understand want , assume ldf list of data frames, can do:

n <- nrow(ldf[[1]])  (name in names(ldf)) {   col <- rep(na_real_, n)   if (!is.null(mean_values[[name]])) col[seq(1, n, 24)] <- mean_values[[name]]   ldf[[name]][["mean_values"]] <- col } 

Comments

Popular posts from this blog

javascript - Replicate keyboard event with html button -

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Web audio api 5.1 surround example not working in firefox -