Summary.R

To create summary of csv file grouped by selected columns using `Rscript.exe` from command-line

5KB
Open

Usage

Rscript summary.R [-c columns] input-csv-file.csv parameters in [..] are optional

How it works:

  • Script outputs descriptive statistics (mean, sd, N, first value, last value) per group from all columns in "input-csv-file.csv".

  • Data can be split into several datasets using grouping columns("Experiment No.", "Drug Conc.", etc.).

  • Grouping columns are specified by "-c " followed by numbers or letters (Excel A-ZZ indexes).

    1. Individual columns are separated by commas (ie "-c 1,9")

    2. When specifying range, use dashes (ie "-c 2-4,5-8")

Examples:

  1. "-c 1,3,5-7" will select columns 1,3,5,6,7.

  2. "-c A,C,E-G" will select columns 1,3,5,6,7.

Notes:

  • Mixed selection ("-c A,5-7" is the same as "-c 1,5-7")

  • Case insensitive ("-c A" is the same as "-c a").

  • The script requires the tidyverse and dplyr packages to be installed on your system.

Last updated