Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to merge couples of Dates and values contained in a unique csv
    primarykey
    data
    text
    <p>We have a csv file with Dates in Excel format and Nav for Manager A and Manager B as follows:</p> <pre><code>Date,Manager A,Date,Manager B 41346.6666666667,100,40932.6666666667,100 41347.6666666667,100,40942.6666666667,99.9999936329992 41348.6666666667,100,40945.6666666667,99.9999936397787 41351.6666666667,100,40946.6666666667,99.9999936714362 41352.6666666667,100,40947.6666666667,100.051441180137 41353.6666666667,100,40948.6666666667,100.04877283951 41354.6666666667,100.000077579585,40949.6666666667,100.068400298752 41355.6666666667,100.00007861475,40952.6666666667,100.070263374822 41358.6666666667,100.000047950872,40953.6666666667,99.9661095940006 41359.6666666667,99.9945012295984,40954.6666666667,99.8578245935173 41360.6666666667,99.9944609274138,40955.6666666667,99.7798031949116 41361.6666666667,99.9944817907402,40956.6666666667,100.029523604978 41366.6666666667,100,40960.6666666667,100.14859511024 41367.6666666667,99.4729804387476,40961.6666666667,99.7956029017769 41368.6666666667,99.4729804387476,40962.6666666667,99.7023420799123 41369.6666666667,99.185046151864,40963.6666666667,99.6124531927299 41372.6666666667,99.1766469096966,40966.6666666667,99.5689030038018 41373.6666666667,98.920738006398,40967.6666666667,99.5701493637685 ,,40968.6666666667,99.4543885041996 ,,40969.6666666667,99.3424528379521 </code></pre> <p>We want to create a zoo object with the following structure [Dates, Manager A Nav, Manager B Nav].</p> <p>After reading the csv file with:</p> <pre><code>data = read.csv("...", header=TRUE, sep=",") </code></pre> <p>we set an index for splitting the object and use lapply to split</p> <pre><code>INDEX &lt;- seq(1, by = 2, length = ncol(data) / 2) data.zoo &lt;- lapply(INDEX, function(i, data) data[i:(i+1)], data = zoo(data)) </code></pre> <p>I'm stuck with the fact that Dates are in Excel format and don't know how to fix that stuff. Is the problem set in a correct way?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload