tutorials:r_plots
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| tutorials:r_plots [2026/09/18 18:01] – chkuo | tutorials:r_plots [2026/10/13 10:44] (current) – [Box plots] hychang | ||
|---|---|---|---|
| Line 4: | Line 4: | ||
| An user guide to walk through data visualization by box plot in R.\\ | An user guide to walk through data visualization by box plot in R.\\ | ||
| - | Please | + | Please |
| - | [[https:// | ||
| - | <file html boxplot.html> | + | ==== One batch with replicates ==== |
| - | < | + | |
| - | < | + | === Single batch boxplot tutorials === |
| + | * {{single-batch_boxplot_v01.pdf}} | ||
| - | < | + | === Sample input === |
| + | * {{sample1.xlsx}} | ||
| - | <meta charset=" | + | === R script |
| - | <meta name=" | + | |
| - | <meta http-equiv=" | + | |
| - | <meta name=" | + | <file r single-batch_boxplot.R> |
| + | # Aim: This R script is about making single batch boxplot. | ||
| - | <meta name=" | + | # Data Description: |
| + | # - sample1.xlsx | ||
| + | # - Sheet1: Contains raw data across two columns: `Strain` and `Value`. Each strain includes 20 replicates. | ||
| + | # - Sheet2: Contains the statistical test result (Tukey' | ||
| + | # | ||
| + | # Output (both pdf and png format): | ||
| + | # - Version 1: Displays all data points using a single color. | ||
| + | # - Version 2: Colors the data points by strain and adds statistical significance group labels at the top. | ||
| + | # | ||
| - | < | + | ### Step 0, Check packages |
| - | < | + | # Required packages |
| - | // be compatible with the behavior of Pandoc | + | packages |
| - | document.addEventListener(' | + | |
| - | var hs = document.querySelectorAll("div.section[class*=' | + | # Check and install required packages |
| - | var i, h, a; | + | for (pkg in packages) { |
| - | for (i = 0; i < hs.length; i++) { | + | if (!requireNamespace(pkg, quietly = TRUE)) { |
| - | h = hs[i]; | + | |
| - | | + | |
| - | | + | |
| - | while (a.length > 0) h.removeAttribute(a[0].name); | + | |
| } | } | ||
| - | }); | + | } |
| - | </ | + | |
| - | < | + | |
| - | !function(e, | ||