Learn R Programming

clinCompare (version 1.0.0)

prepare_datasets: Prepare Datasets for Comparison

Description

Prepares two datasets for comparison by optionally sorting by specified columns and filtering rows based on a condition.

Usage

prepare_datasets(df1, df2, sort_columns = NULL, filter_criteria = NULL)

Value

A list containing two prepared datasets.

Arguments

df1

First dataset to be prepared.

df2

Second dataset to be prepared.

sort_columns

Columns to sort the datasets by.

filter_criteria

Criteria for filtering the datasets.

Examples

Run this code
# \donttest{
  df1 <- data.frame(id = c(3, 1, 2), score = c(70, 90, 80))
  df2 <- data.frame(id = c(2, 3, 1), score = c(80, 75, 90))
  prepare_datasets(df1, df2, sort_columns = "id", filter_criteria = "score > 75")
# }

Run the code above in your browser using DataLab