R ggplot2: using stat_summary (mean) and logarithmic scale

前端 未结 3 1905
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 02:46

I have a bunch of measurements over time and I want to plot them in R. Here is a sample of my data. I\'ve got 6 measurements for each of 4 time points:

value         


        
3条回答
  •  Happy的楠姐
    2020-12-07 03:21

    A work around to solve it, if you don´t want to use coord_trans() and still want to transform the data, is to create a function which will back transform it:

    f1 <- function(x) {
      log10(mean(10 ^ x)) 
    }
    
    stat_summary (fun.y = f1, geom="line", mapping = aes (group = 1))
    

提交回复
热议问题