### Install mmequiv Development Version Source: https://github.com/kennethataylor/mmequiv/blob/main/README.md Installs the development version of the mmequiv package from GitHub using the remotes package. This allows users to access the latest features and bug fixes before they are released on CRAN. ```r # install.packages("remotes") remotes::install_github('KennethATaylor/mmequiv') ``` -------------------------------- ### Install mmequiv from CRAN Source: https://github.com/kennethataylor/mmequiv/blob/main/README.md Installs the mmequiv package from the Comprehensive R Archive Network (CRAN). This is the standard method for installing stable releases of R packages. ```r install.packages("mmequiv") ``` -------------------------------- ### MMEquiv: Validating Medication Names Against Known List Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme.md Shows an example of how the function validates medication names against an internal list. If a name is not accepted, an error is thrown, and users are directed to `get_med_list()`. ```R calculate_mme(invalid_medication, 10, 5) ``` -------------------------------- ### Data Validation Examples for calculate_mme_df Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md Demonstrates how the `calculate_mme_df` function handles various input validation errors. This includes cases where the specified ID column is missing, required columns are absent in the data frame, or the input data is not in the expected format. ```R calculate_mme_df(data = test_data, id_col = "missing_column") # Error in `calculate_mme_df()`: # ! `id_col` column "missing_column" not found in `data` ``` ```R calculate_mme_df(data = bad_data) # Error in `calculate_mme_df()`: # ! bad_data is missing required columns: "medication_name" ``` ```R calculate_mme_df(data = bad_data2, therapy_days_without_col = "therapy_days_without") # Error in `calculate_mme_df()`: # ! bad_data2 is missing required columns: "therapy_days_without" ``` ```R calculate_mme_df(data = output) # Error in `calculate_mme_df()`: # ! `data` must be a or # x output is a ``` -------------------------------- ### Get Citation Information for mmequiv Source: https://github.com/kennethataylor/mmequiv/blob/main/README.md Retrieves citation information for the mmequiv R package. This function provides the necessary details to properly cite the package in academic publications or research projects. ```r citation("mmequiv") ``` -------------------------------- ### mmequiv 0.1.0 - Initial CRAN Submission Source: https://github.com/kennethataylor/mmequiv/blob/main/NEWS.md This marks the initial release of the mmequiv package submitted to CRAN. ```R # Initial CRAN submission. ``` -------------------------------- ### mmequiv 0.1.1 - CRAN Review Updates Source: https://github.com/kennethataylor/mmequiv/blob/main/NEWS.md Version 0.1.1 includes updates made in response to feedback from a CRAN review, ensuring compliance with package submission guidelines. ```R # Updates in response to CRAN review. ``` -------------------------------- ### MMEquiv Data Table Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This snippet represents a section of the MMEquiv project data, likely from a larger dataset or report. It includes columns for an index, product code (Pxxx), and several numerical metrics. The data appears to be structured for analysis of product performance or cost. ```plaintext 2 P002 14 30 924.00 28 3 P003 7 30 2228.00 31 4 P004 7 30 210.00 7 5 P005 7 30 47.25 7 6 P006 7 30 3395.25 31 7 P007 5 30 50.00 5 8 P008 7 30 3136.00 7 9 P009 3 30 108.00 3 10 P010 28 42 5040.00 28 11 P011 7 30 2362.50 14 12 P012 10 30 1345.00 31 13 P013 3 30 17853.75 80 14 P014 30 45 13207.50 120 15 P015 7 30 57.75 7 16 P016 10 30 630.00 10 17 P017 10 30 1826.50 54 18 P018 14 30 378.00 14 19 P019 14 30 2016.00 14 20 P020 30 45 3030.00 40 21 P021 10 30 1099.50 41 22 P022 28 42 1160.00 38 23 P023 3 30 270.00 3 24 P024 30 45 15360.00 30 25 P025 5 30 10005.00 65 26 P026 7 30 7276.50 84 27 P027 7 30 315.00 7 28 P028 10 30 742.00 18 29 P029 5 30 960.00 5 30 P030 10 30 140.00 10 31 P031 14 30 6172.50 134 32 P032 30 45 5332.50 37 33 P033 10 30 1002.00 24 34 P034 10 30 795.00 24 35 P035 7 30 1170.00 27 36 P036 3 30 450.00 10 37 P037 3 30 410.00 10 38 P038 14 30 2785.00 58 39 P039 10 30 1325.00 28 40 P040 10 30 2300.00 40 41 P041 7 30 617.50 29 42 P042 10 30 499.50 10 43 P043 30 45 1110.00 40 44 P044 7 30 1637.25 22 45 P045 30 45 885.00 42 46 P046 90 135 8194.50 97 47 P047 30 45 2460.00 44 48 P048 10 30 80.00 10 49 P049 30 45 270.00 30 50 P050 7 30 1075.00 45 51 P051 10 30 1020.50 24 52 P052 7 30 105.00 7 53 P053 10 30 1183.50 47 54 P054 30 45 2107.50 50 55 P055 28 42 3125.00 68 56 P056 30 45 1023.75 35 57 P057 14 30 52.50 14 58 P058 14 30 1501.50 21 59 P059 14 30 2040.00 54 60 P060 3 30 285.00 10 61 P061 3 30 450.00 3 62 P062 5 30 630.00 25 63 P063 10 30 225.00 10 64 P064 3 30 49.50 3 ``` -------------------------------- ### Project Data Table 1 Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This snippet displays a table of project data, likely representing different items or samples identified by a code (e.g., P045). Each item has associated numerical values, potentially indicating quantities, costs, or other metrics. ```plaintext 45 P045 30 45 885.00 42 46 P046 90 135 8194.50 97 47 P047 30 45 2460.00 44 48 P048 10 30 80.00 10 49 P049 30 45 765.00 60 50 P050 7 30 1075.00 45 51 P051 10 30 1020.50 24 52 P052 7 30 105.00 7 53 P053 10 30 1183.50 47 54 P054 30 45 2107.50 50 55 P055 28 42 3125.00 68 56 P056 30 45 1023.75 35 57 P057 14 30 52.50 14 58 P058 14 30 10037.50 31 59 P059 14 30 2040.00 54 60 P060 3 30 285.00 10 61 P061 3 30 450.00 3 62 P062 5 30 630.00 25 63 P063 10 30 225.00 10 64 P064 3 30 49.50 3 65 P065 30 45 1944.75 50 66 P066 7 30 462.00 7 67 P067 30 45 12312.75 84 68 P068 5 30 1850.00 19 69 P069 10 30 688.50 17 70 P070 10 30 1900.00 70 71 P071 7 30 4865.00 44 72 P072 14 30 1691.00 59 73 P073 7 30 21200.00 88 74 P074 7 30 1510.00 37 75 P075 3 30 405.00 3 76 P076 30 45 8304.00 104 77 P077 5 30 504.75 15 78 P078 10 30 1007.00 27 79 P079 10 30 3899.00 24 80 P080 10 30 1840.00 30 81 P081 10 30 607.50 17 82 P082 3 30 1338.00 20 83 P083 30 45 4720.00 40 84 P084 14 30 1232.50 24 85 P085 5 30 1537.50 45 86 P086 14 30 9450.00 14 87 P087 7 30 3544.00 87 88 P088 10 30 2122.50 50 89 P089 14 30 14464.60 31 90 P090 7 30 155.25 10 91 P091 3 30 877.50 27 92 P092 30 45 1363.50 47 93 P093 7 30 262.50 7 94 P094 5 30 1464.50 36 95 P095 7 30 350.00 7 96 P096 10 30 1000.00 10 97 P097 7 30 20082.00 40 98 P098 7 30 840.00 7 99 P099 90 135 6038.50 130 100 P100 5 30 90.00 5 ``` -------------------------------- ### Missing Specific Therapy Column Validation Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme.data.frame.md This example illustrates the validation when a specific column, like 'therapy_days_without', is missing from the input data frame `bad_data2`, even when other parameters are provided. The function should identify the missing 'therapy_days_without' column. ```R calculate_mme(x = bad_data2, therapy_days_without_col = "therapy_days_without") # Error in `calculate_mme()`: # ! bad_data2 is missing required columns: "therapy_days_without" ``` -------------------------------- ### API Usage Advisory for <50 Patients Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/api_rate_limit_helpers.md Shows the advisory message from `advise_api_usage` when the number of patients is below the API rate limit threshold. It informs the user about the rate limit and suggests local calculation if issues arise. ```R advise_api_usage(n_patients = 30, use_api = TRUE) ``` ```R advise_api_usage(n_patients = 30, use_api = FALSE) ``` -------------------------------- ### Project Data Table Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This section displays a table containing project-related data. Each row is identified by a number and a project code (e.g., P067). Columns include numerical values that likely represent different metrics or measurements for each project code. ```plaintext 67 P067 30 45 12312.75 84 68 P068 5 30 1850.00 19 69 P069 10 30 688.50 17 70 P070 10 30 1900.00 70 71 P071 7 30 4865.00 44 72 P072 14 30 1691.00 59 73 P073 7 30 21200.00 88 74 P074 7 30 1510.00 37 75 P075 3 30 405.00 3 76 P076 30 45 8304.00 104 77 P077 3 20 300.00 5 78 P078 10 30 1007.00 27 79 P079 10 30 3899.00 24 80 P080 10 30 1840.00 30 81 P081 10 30 607.50 17 82 P082 3 30 1338.00 20 83 P083 30 45 4720.00 40 84 P084 14 30 1232.50 24 85 P085 1 29 1050.00 40 86 P086 14 30 9450.00 14 87 P087 7 30 3544.00 87 88 P088 10 30 2122.50 50 89 P089 10 23 613.00 24 90 P090 7 30 155.25 10 91 P091 3 30 877.50 27 92 P092 30 45 1363.50 47 93 P093 7 30 262.50 7 94 P094 5 30 1464.50 36 95 P095 7 30 350.00 7 96 P096 10 30 1000.00 10 97 P097 7 30 20082.00 40 98 P098 7 30 840.00 7 99 P099 90 135 6038.50 130 100 P100 5 30 90.00 5 ``` -------------------------------- ### Project Data Table Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This snippet displays a table of project data. Each row represents a project with associated numerical values across multiple columns. The data is presented in a fixed-width format for readability. ```plaintext 4 P004 7 30 210.00 7 5 P005 7 30 47.25 7 6 P006 7 30 3395.25 31 7 P007 5 30 50.00 5 8 P008 7 30 3136.00 7 9 P009 3 30 108.00 3 10 P010 28 42 5040.00 28 11 P011 7 30 2362.50 14 12 P012 10 30 1345.00 31 13 P013 3 30 17853.75 80 14 P014 30 45 13207.50 120 15 P015 7 30 57.75 7 16 P016 6 29 630.00 10 17 P017 10 30 1826.50 54 18 P018 14 30 378.00 14 19 P019 14 30 2016.00 14 20 P020 30 45 3030.00 40 21 P021 10 30 1099.50 41 22 P022 28 42 1160.00 38 23 P023 3 30 270.00 3 24 P024 30 45 15360.00 30 25 P025 5 30 10005.00 65 26 P026 7 30 7276.50 84 27 P027 7 30 315.00 7 28 P028 10 30 742.00 18 29 P029 5 30 960.00 5 30 P030 10 30 140.00 10 31 P031 14 30 6172.50 134 32 P032 30 45 5332.50 37 33 P033 10 30 1002.00 24 34 P034 10 30 795.00 24 35 P035 7 30 1170.00 27 36 P036 3 30 450.00 10 37 P037 3 30 410.00 10 38 P038 14 30 2785.00 58 39 P039 10 30 1325.00 28 40 P040 10 30 2300.00 40 41 P041 5 28 617.50 29 42 P042 10 30 499.50 10 43 P043 30 45 1110.00 40 44 P044 7 30 1637.25 22 45 P045 30 45 885.00 42 46 P046 90 135 8194.50 97 47 P047 30 45 2460.00 44 48 P048 10 30 80.00 10 49 P049 26 41 270.00 30 50 P050 7 30 1075.00 45 51 P051 10 30 1020.50 24 52 P052 7 30 105.00 7 53 P053 10 30 1183.50 47 54 P054 30 45 2107.50 50 55 P055 28 42 3125.00 68 56 P056 30 45 1023.75 35 57 P057 14 30 52.50 14 58 P058 11 23 1501.50 21 59 P059 14 30 2040.00 54 60 P060 3 30 285.00 10 61 P061 3 30 450.00 3 62 P062 5 30 630.00 25 63 P063 10 30 225.00 10 64 P064 3 30 49.50 3 65 P065 26 39 1096.50 40 66 P066 7 30 462.00 7 ``` -------------------------------- ### Project Data Table 2 Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This snippet presents a second table of project data, featuring column headers 'mme1', 'mme2', 'mme3', and 'mme4'. It appears to contain numerical values corresponding to different measurement or evaluation metrics for a series of items, likely indexed from 1 to 10. ```plaintext mme1 mme2 mme3 mme4 1 25.94595 137.14286 32.000000 55.000 2 33.00000 66.00000 30.800000 66.000 3 71.87097 318.28571 74.266667 204.000 4 30.00000 30.00000 7.000000 30.000 5 6.75000 6.75000 1.575000 6.750 6 109.52419 485.03571 113.175000 393.750 7 10.00000 10.00000 1.666667 10.000 8 448.00000 448.00000 104.533333 448.000 9 36.00000 36.00000 3.600000 36.000 10 180.00000 180.00000 120.000000 180.000 ``` -------------------------------- ### MMEquiv Metrics Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This section presents a breakdown of metrics labeled mme1 through mme4, corresponding to different project identifiers. The data shows numerical values for each metric, likely representing calculated or observed quantities. ```plaintext mme1 mme2 mme3 mme4 1 25.94595 137.14286 32.000000 55.00 2 33.00000 66.00000 30.800000 66.00 3 71.87097 318.28571 74.266667 204.00 4 30.00000 30.00000 7.000000 30.00 5 6.75000 6.75000 1.575000 6.75 6 109.52419 485.03571 113.175000 393.75 7 10.00000 10.00000 1.666667 10.00 8 448.00000 448.00000 104.533333 448.00 9 36.00000 36.00000 3.600000 36.00 10 180.00000 180.00000 120.000000 180.00 11 168.75000 337.50000 78.750000 337.50 12 43.38710 134.50000 44.833333 130.00 13 223.17188 5951.25000 595.125000 405.25 14 110.06250 440.25000 293.500000 160.25 15 8.25000 8.25000 1.925000 8.25 16 63.00000 105.00000 21.724138 63.00 17 33.82407 182.65000 60.883333 87.35 18 27.00000 27.00000 12.600000 27.00 19 144.00000 144.00000 67.200000 144.00 20 75.75000 101.00000 67.333333 123.00 21 26.81707 109.95000 36.650000 100.75 22 30.52632 41.42857 27.619048 80.00 23 90.00000 90.00000 9.000000 90.00 24 512.00000 512.00000 341.333333 512.00 25 153.92308 2001.00000 333.500000 186.00 26 86.62500 1039.50000 242.550000 333.00 27 45.00000 45.00000 10.500000 45.00 28 41.22222 74.20000 24.733333 114.00 29 192.00000 192.00000 32.000000 192.00 30 14.00000 14.00000 4.666667 14.00 31 46.06343 440.89286 205.750000 283.25 32 144.12162 177.75000 118.500000 229.50 33 41.75000 100.20000 33.400000 133.50 34 33.12500 79.50000 26.500000 67.50 35 43.33333 167.14286 39.000000 129.00 36 45.00000 150.00000 15.000000 70.00 37 41.00000 136.66667 13.666667 110.00 38 48.01724 198.92857 92.833333 183.50 39 47.32143 132.50000 44.166667 178.50 40 57.50000 230.00000 76.666667 110.00 41 21.29310 123.50000 22.053571 82.50 42 49.95000 49.95000 16.650000 49.95 43 27.75000 37.00000 24.666667 51.00 44 74.42045 233.89286 54.575000 188.25 45 21.07143 29.50000 19.666667 108.75 46 84.47938 91.05000 60.700000 103.50 ``` -------------------------------- ### Check Unique Patients with API Rate Limit Warning Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/api_rate_limit_helpers.md Demonstrates the `check_unique_pat` function when exceeding the API rate limit. It shows the warning message and suggests local calculation as an alternative. ```R check_unique_pat(n_patients = 60, use_api = TRUE) ``` ```R check_unique_pat(n_patients = 40, use_api = TRUE) ``` -------------------------------- ### Project Data Table Source: https://github.com/kennethataylor/mmequiv/blob/main/tests/testthat/_snaps/calculate_mme_df.md This snippet displays a table of numerical data, likely experimental results or calculated values. It includes row identifiers (e.g., P065, P066) and column headers (mme1, mme2, mme3, mme4) with corresponding floating-point values. The data appears to be structured for analysis and comparison. ```text 65 P065 30 45 1096.50 40 66 P066 7 30 462.00 7 67 P067 30 45 12312.75 84 68 P068 5 30 1850.00 19 69 P069 10 30 688.50 17 70 P070 10 30 1900.00 70 71 P071 7 30 4865.00 44 72 P072 14 30 1691.00 59 73 P073 7 30 21200.00 88 74 P074 7 30 1510.00 37 75 P075 3 30 405.00 3 76 P076 30 45 8304.00 104 77 P077 5 30 300.00 5 78 P078 10 30 1007.00 27 79 P079 10 30 3899.00 24 80 P080 10 30 1840.00 30 81 P081 10 30 607.50 17 82 P082 3 30 1338.00 20 83 P083 30 45 4720.00 40 84 P084 14 30 1232.50 24 85 P085 5 30 1050.00 40 86 P086 14 30 9450.00 14 87 P087 7 30 3544.00 87 88 P088 10 30 2122.50 50 89 P089 14 30 613.00 24 90 P090 7 30 155.25 10 91 P091 3 30 877.50 27 92 P092 30 45 1363.50 47 93 P093 7 30 262.50 7 94 P094 5 30 1464.50 36 95 P095 7 30 350.00 7 96 P096 10 30 1000.00 10 97 P097 7 30 20082.00 40 98 P098 7 30 840.00 7 99 P099 90 135 6038.50 130 100 P100 5 30 90.00 5 mme1 mme2 mme3 mme4 1 25.94595 137.14286 32.000000 55.00 2 33.00000 66.00000 30.800000 66.00 3 71.87097 318.28571 74.266667 204.00 4 30.00000 30.00000 7.000000 30.00 5 6.75000 6.75000 1.575000 6.75 6 109.52419 485.03571 113.175000 393.75 7 10.00000 10.00000 1.666667 10.00 8 448.00000 448.00000 104.533333 448.00 9 36.00000 36.00000 3.600000 36.00 10 180.00000 180.00000 120.000000 180.00 11 168.75000 337.50000 78.750000 337.50 12 43.38710 134.50000 44.833333 130.00 13 223.17188 5951.25000 595.125000 405.25 14 110.06250 440.25000 293.500000 160.25 15 8.25000 8.25000 1.925000 8.25 16 63.00000 63.00000 21.000000 63.00 17 33.82407 182.65000 60.883333 87.35 18 27.00000 27.00000 12.600000 27.00 19 144.00000 144.00000 67.200000 144.00 20 75.75000 101.00000 67.333333 123.00 21 26.81707 109.95000 36.650000 100.75 22 30.52632 41.42857 27.619048 80.00 23 90.00000 90.00000 9.000000 90.00 24 512.00000 512.00000 341.333333 512.00 25 153.92308 2001.00000 333.500000 186.00 26 86.62500 1039.50000 242.550000 333.00 27 45.00000 45.00000 10.500000 45.00 28 41.22222 74.20000 24.733333 114.00 29 192.00000 192.00000 32.000000 192.00 30 14.00000 14.00000 4.666667 14.00 31 46.06343 440.89286 205.750000 283.25 32 144.12162 177.75000 118.500000 229.50 33 41.75000 100.20000 33.400000 133.50 34 33.12500 79.50000 26.500000 67.50 35 43.33333 167.14286 39.000000 129.00 36 45.00000 150.00000 15.000000 70.00 37 41.00000 136.66667 13.666667 110.00 38 48.01724 198.92857 92.833333 183.50 39 47.32143 132.50000 44.166667 178.50 40 57.50000 230.00000 76.666667 110.00 41 21.29310 88.21429 20.583333 82.50 42 49.95000 49.95000 16.650000 49.95 43 27.75000 37.00000 24.666667 51.00 ```