Question: Summarise statistics Fst values of SNPs list
0
gravatar for paolo002
15 months ago by
paolo002150
paolo002150 wrote:

Hi, I have a data frame with Fst values for different SNPs windows.

I would like to summarise the mean and median of the Fst values for each gene windows:

            gene chr    start Nsites     Fst01    Fst02    Fst12     
1     AC002310.7  16 30591000      2       1       8.      5
2         ZNF785  16 30591000      2       1       30     1
3     AC002310.7  16 30593000      2       2       4.     10
4         ZNF785  16 30593000      2       3       20.    2
5     AC002310.7  16 30595000      2       3       2.     20
6         ZNF785  16 30595000      2       6.      10.    3

Output:

          gene       n   Fst01    Fst02    Fst12     
1     AC002310.7     3    2.        4.      10
2         ZNF785     3    3.       20       2

I wrote something like this:

df %>% summarise_at(group_by(df, gene), vars(Fst01, Fst02,Fst12), funs(n(),mean))

but it is giving me the following error:

Error: `.vars` must be a character/numeric vector or a `vars()` object, not list
Call `rlang::last_error()` to see a backtrace

Any help, highly appreciated, cheers

R • 394 views
ADD COMMENTlink written 15 months ago by paolo002150

solved on stackoverflow:

https://stackoverflow.com/questions/53874047/summarise-mean-median-data-frame-r

ADD REPLYlink written 15 months ago by paolo002150
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1023 users visited in the last hour