View source: R/predictors_functions.R
scatterplot_predictions | R Documentation |
Function to visualize a scatter-plot comparing two variables
scatterplot_predictions(x, p, title, xname = "x", yname = "predicted x")
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 |
plotly image with the scatterplot
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.