knitr::opts_chunk$set(echo = FALSE
                      , results = 'asis'
                      , warning = FALSE
                      , message = FALSE)

Purpose

Merge two files based on a single unique identifier column shared between the two files.

All rows and columns in File 1 (Primary) will be carried through into the output file. For File 2, only data for rows that match with File 1 via the common identifier will be carried through into the output file.

The user will select a single common identifier from each file to perform the merge (e.g., SampleID). The common identifier doesn’t need to be named the same thing in both files. Just click on the drop-down menus and the list of fields in your input files will appear. Select the correct identifiers from each file.

In the output file, column names that overlap across the two files will have the suffix ‘.x’ or ‘.y’ for files 1 and 2 , respectively.

The user will have the option of viewing both input files before merging.

You can only merge two files at a time. If you want to join more, do one pair first, then join that file with the next file, and so on.

Merge file conceptual layout.

Potential Applications

If you’re running the BCG calculator and are building your input file with the Taxa Translator/Attribute and Add Index Name/Class functions, you can use the Merge Files function to join those two files. Your output file will be ready to run through the BCG calculator.

You can also use the Merge Files function to join outputs from the various calculations (for example, the BCG model output and the thermal preference metrics output). Then you can examine whether changes in BCG levels are associated with changes in thermal indicator taxa (which could indicate thermal alteration).

Test File

Click here to download a pair of test files.

Click here to download example R scripts and data (all functions).


Last updated 2023-02-03



leppott/BCGcalc documentation built on May 17, 2024, 5:55 p.m.