propRegional: Summary of proportion of a medicine precribed for a regional...

View source: R/propRegional.R

propRegionalR Documentation

Summary of proportion of a medicine precribed for a regional unit over time

Description

Function to create tsibble object for a count of 'unit' per 'datename' e.g. countRegional(oc, Locality, datename, Quantity) is the 'Quantity' per 'datename' grouped by 'Locality' from 'oc'. 'Quantity' is corrected for the number of days in each month.

Usage

propRegional(data, region, datename = datename, unit = Quantity, bnf)

Arguments

data

A dataframe with date and unit of medicines with multiple BNF codes

region

Column name of regional unit of interest (e.g., 'practiceid', 'gp_cluster')

datename

Name of the column containing the date data

unit

Unit of interest (e.g., 'quantity', 'items')

bnf

BNF code of medicine of interest

Value

Dataframe of proportion of 'bnf' prescribed grouped by date and regional unit

Examples

## Not run: propRegional(data, region = practiceid)


w-hardy/serCymruTools documentation built on April 28, 2022, 6:49 p.m.