Skip to content
Learn Netverks

Lesson

Step 24/36 67% through track

descriptive-stats

Descriptive statistics

Last reviewed Jun 1, 2026 Content v20260601
Track mode
server_script
Means
Server runner
Reading
~1 min
Level
intermediate

This lesson

This lesson teaches Descriptive statistics: the syntax, patterns, and safety habits you need before advancing in R.

Teams still ship Descriptive statistics in R codebases—skipping it leaves gaps in debugging and code reviews.

You will apply Descriptive statistics in contexts like: Research pipelines, Shiny dashboards, and statistical reporting.

Write R in the editor and click Run on server—the dev runner executes with Rscript; use print() or cat() and base R in playground snippets (tidyverse locally; LEARNING_RUNNER_ENABLED=true).

When you can explain the previous lesson's ideas without copying starter code.

Summarize data with mean(), median(), sd(), quantile(), and summary()—foundation before inference.

summary() and friends

x <- c(10, 12, 14, 18, 23)
print(summary(x))
print(sd(x))

Grouped summaries (base)

df <- data.frame(group = c("A", "A", "B", "B"), val = c(10, 12, 20, 22))
print(aggregate(val ~ group, data = df, FUN = mean))

dplyr group_by() + summarise() is the tidyverse equivalent locally.

Important interview questions and answers

  1. Q: Mean vs median?
    A: Mean sensitive to outliers; median robust for skewed distributions.
  2. Q: sample sd?
    A: R's sd() uses n-1 denominator (sample standard deviation).

Self-check

  1. What function returns five-number summary?
  2. What does aggregate() do?

Tip: Report median with skewed data—mean alone misleads stakeholders.

Interview prep

Mean vs median?

Median resists outliers; mean reflects the arithmetic average.

Interview tip Lesson completion confidence

Can you explain this lesson in 30 seconds without reading notes?

Not saved yet.

Playground

Runs on the configured server runner (dev: npm run runner with LEARNING_RUNNER_ENABLED=true). Output appears below the editor.

Check yourself

Multiple choice — immediate feedback.

Discussion

Past discussion is visible to everyone. Only logged-in users can post comments and replies.

Starter discussion topics

  • summary() limits?
  • table() factors?

Sign up or log in to post comments and sync lesson progress across devices.

No discussion yet. Be the first to ask a question.

Jump