Rscript -e 'summary(read.csv("data.csv"))'

Category: Data Science & Analysis

Rscript -e 'summary(read.csv("data.csv"))'

Print summary statistics for every CSV column

Rscript runs R code from the command line without opening the interactive session. The -e flag takes code as a string: read.csv loads data.csv into a data frame, and summary prints min, quartiles, mean, max, and missing-value counts per column. This one-liner is the R equivalent of csvstat. For a single column, wrap it like summary of the column with the dollar sign syntax.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.