0

I have a data frame, df, which I have stacked and merged with another data frame, info_df.

I call it Ta_stacked

On the basis of info_df I sort my stacked data frame, by the column Progression. After that I remove the columns from the info_df

sorted_stacked = arrange(Ta_stacked, Progression) %>%    
    select(gene_ekspression, sample) %>% drop_levels()

When I unstack my new sorted df, the sorting I did is overruled by unstacks alphabetically sorting.

sorted_df = unstack(sorted_stacked))

I have tried to use the as.data.frame:

sorted_df = as.data.frame(unstack(sorted_stacked))

Any ideas on what to do?

Here is pictures of my workflow, the matrices is just examples because I am working with a really big dataset.

examples of datasets My workflow with unstacking

  • 3
    Please provide a small reproducible example (preferably using `dput`) and expected output. – akrun Sep 22 '16 at 09:27
  • I have added two pictures of my workflow. – user6863269 Sep 22 '16 at 10:28
  • Pictures are not reproducible. Use `dput` or include code to create toy data that reproduces your problem. See [here](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) for more details. – lmo Sep 22 '16 at 12:04

0 Answers0