pcApprox: Approximating data with principal components

Description Usage Arguments Value Examples

View source: R/dimensionality.R

Description

Takes in a tibble or data frame of observations (rows) of several numeric variables (columns), and return an approximation of the data using a given number of first principal components.

Usage

1
pcApprox(x, npc)

Arguments

x

A tibble or data frame containing the data to be approximated.

npc

The numbers of first principal components to use when approximating the data.

Value

Approximated data with the first npc principal components.

Examples

1
2
3
data=read.csv('https://jlucasmckay.bmi.emory.edu/global/bmi585/heart.csv')
data=data[,c('Age','RestBP','Chol','MaxHR','Oldpeak')]
pcApprox(data,3)

loublanpain/BMI585FinalProjectLouBlanpain documentation built on Dec. 21, 2021, 11:49 a.m.