Skip to content
Snippets Groups Projects
Select Git revision
  • ec475c5fcd75515aa28929dce37f6efbe029e9d9
  • master default protected
  • dev
  • v0.2.9
  • v0.2.8
  • v0.2.7
  • v0.2.6
  • v0.1.0
  • v0.2.5
  • v0.2.4
  • v0.2.3
  • v0.2.2
  • v0.2.1
  • v0.2.0
  • v0.1.2
15 results

Dockerfile

Blame
  • Forked from LBMC / nextflow
    Source project has a limited visibility.
    identity_plot.R 1.29 KiB
    # WARNING - Generated by {fusen} from /dev/flat_full.Rmd: do not edit by hand
    
    
    #' Generate an identity plot
    #'
    #' This function generates an identity plot for comparing actual values with estimates.
    #'
    #' @param comparison_df A data frame containing comparison results with "actual" and "estimate" columns.
    #' @param ... additional parameters to pass ggplot2::aes 
    #' @return A ggplot2 identity plot.
    #'
    #' @importFrom ggplot2 sym aes geom_point geom_abline facet_wrap theme_bw ggtitle scale_x_log10 scale_y_log10
    #' @importFrom rlang .data
    #' @export
    #' @examples
    #'   comparison_data <- data.frame(
    #'    actual = c(1, 2, 3, 4, 5),
    #'    estimate = c(0.9, 2.2, 2.8, 4.1, 5.2),
    #'    description = rep("Category A", 5))
    #' identity_plot(comparison_data)
    
    identity_plot <- function(comparison_df, ...){
      
      args <- lapply(list(...), function(x) if (!is.null(x)) ggplot2::sym(x))
    
      
      ggplot2::ggplot(comparison_df) +
        ggplot2::geom_point(ggplot2::aes(x = .data$actual, y = .data$estimate, !!!args), alpha = 0.6, size = 2)  +
        ggplot2::geom_abline(intercept = 0, slope = 1, lty = 3, col = 'red', linewidth = 1) +
        ggplot2::facet_wrap(~description, scales = "free") +
        ggplot2::theme_bw()  +
        ggplot2::ggtitle("Identity plot") #+
        #ggplot2::scale_x_log10() +
        #ggplot2::scale_y_log10()
        
    
    }