predictAMR: Predict AMR from PCA.

Description Usage Arguments Value Examples

View source: R/predictAMR.R

Description

A function that predict multi-drug resistance by principle component analysis (PCA) to show the new sample's in the original cluster.

Usage

1
predictAMR(dataframe, new_data)

Arguments

dataframe

A dataframe with rownames representing the sample ID and each column is one of sample's antimicrobial features. If the value equals to 1, the sample has this antimicrobial feature. If the value equals to 0, the sample does not have this antimicrobial feature.

new_data

The new data of dataframe must contain columns (variables) with the same names and in the same order as the data used to compute PCA.

Value

Returns the PCA result of the new sample.

Examples

1
2
3
4
5
6
7
# Example 3
# Using pca_data available with package
dim(pca_data)
data.active <- pca_data[c(1:17), c(2,9,16)]
new.active <- pca_data[c(18:20), c(2,9,16)]
resultsExample3 <- predictAMR(data.active, new.active)
resultsExample3

ClorisZhou2000/MDRClassifier documentation built on Dec. 17, 2021, 2:06 p.m.