Skip to content
Prev 385294 / 398502 Next

Reorganize the data (dplyr or other packages?)

Well, not that there is anything "wrong" with previous suggestions, but it
is pretty straightforward just with base R functionality:
+                     direction = rep(nm, e = 3),
+                     percentage = do.call(c, tab[, nm]))
+     )
         date direction percentage
down1 2019M08      down 0.01709827
down2 2019M09      down 0.02094724
down3 2019M10      down 0.01750911
uc1   2019M08        uc 0.26538820
uc2   2019M09        uc 0.22657970
uc3   2019M10        uc 0.24500300
up1   2019M08        up 0.71751360
up2   2019M09        up 0.75247310
up3   2019M10        up 0.73748790


Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Aug 17, 2020 at 9:53 AM Rasmus Liland <jral at posteo.no> wrote: