Learn R Programming

MiMIR (version 1.5)

scatterplot_predictions: scatterplot_predictions

Description

Function to visualize a scatter-plot comparing two variables

Usage

scatterplot_predictions(x, p, title, xname = "x", yname = "predicted x")

Value

plotly image with the scatterplot

Arguments

x

numeric vector

p

second numeric vector

title

string vector with the title

xname

string vector with the name of the variable on the x axis

yname

string vector with the name of the variable on the y axis

Examples

Run this code
library(plotly)
#load the dataset
metabolic_measures <- synthetic_metabolic_dataset
phenotypes <- synthetic_phenotypic_dataset

#Pre-process the metabolic features
prepped_met<-QCprep(as.matrix(metabolic_measures), MiMIR::PARAM_metaboAge)
#Apply the metaboAge
metaboAge<-apply.fit(prepped_met, FIT=PARAM_metaboAge$FIT_COEF)

age<-data.frame(phenotypes$age)
rownames(age)<-rownames(phenotypes)
scatterplot_predictions(age, metaboAge, title="Chronological Age vs MetaboAge")

Run the code above in your browser using DataLab