Skip to content

Introduction to Statistics in R

Run the hidden code cell below to import the data used in this course.


1 hidden cell

Take Notes

Add notes about the concepts you've learned and code cells with code you want to keep.

Add your notes here

glimpse(deals)

In case of Sampling with replacement, each pick is independent & in case of sampling without replacement, each pick is dependent.

deals |>
	group_by(product) |>
	summarise(count = n())
deals |> count(product)
# Count the number of deals per product
# Calculate the probability of each product based on the count
deals |>
	count(product) |>
	mutate(prob = n / sum(n))
set.seed(31)
deals |>
	sample_n(5)