create_plot_df_from_count_df: Create Plot Dataframe From Count Dataframe This function...

View source: R/data_manipulation_functions.R

create_plot_df_from_count_dfR Documentation

Create Plot Dataframe From Count Dataframe This function creates a summary of the name and value column.

Description

The name column is filtered for only values that equal the column_value.

Usage

create_plot_df_from_count_df(column, count_column, data)

Arguments

column

A value that exists in the "name" column of the data

count_column

A string that is the new column name

data

A tibble

Details

The name and value column are pivoted so that a new column is created that has the name of the column value. The number of rows will equal the number of unique value in the value column, where the name column is equal to the column_value

Finally the counts column is renamed the using the count_column

Examples

 data <- dplyr::tribble(
 ~studyName, ~name,          ~value,                   ~count,
 "s1",       "assay",        "immunohistochemistry",   395L,
 "s1",       "resourceType", "experimentalData",       416L,
 "s1",       "resourceType", "report",                 12L,
 "s1",       "species",      "Human",                  421L,
 "s1",       "tumorType",    "Cutaneous Neurofibroma", 387L
)
create_plot_df_from_count_df("assay", "Assays", data)

Sage-Bionetworks/projectliveModules documentation built on June 26, 2022, 1:11 a.m.