study_count | R Documentation |
This simple function counts how many studies are in a dataset
or in different subsets of your data. It assumes your dataset
has a variable called unique_study_id
.
study_count(dataset, counting_var = "unique_study_id")
dataset |
The dataset or subset. |
counting_var |
The variable to count unique observations (default: "unique_study_id"). |
A tibble with the count of distinct observations.
# simple example: entire datasets
PaluckMetaSOP::sv_data |> study_count()
# example with split, apply to many datasets, and create summary table
## Not run:
library(purrr)
PaluckMetaSOP::sv_data |> split(~study_design) |>
map(study_count) |> bind_rows(.id = "study_design")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.