Giter Club home page Giter Club logo

chemhelper's Introduction

ChemHelper

Project Status: Unsupported – The project has reached a stable, usable state but the author(s) have ceased all work on it. A new maintainer may be desired. Travis build statuscodecov

I created this package as a place to house custom functions I've used a lot in analyses of analytical chemistry data durring my PhD. Some of these functions are essentially tidy wrappers for functions from the ropls package that allow extraction of results from model objects into tidy data frames. the *_IA() functions deal with csv files output by Ion Analytics, an in-house deconvolution software. Although it exports data as csv files, they are challenging due to line breaks within column headings, and a few other issues. Other utilities include a version of scale() with many additional options for scaling, and a function to calculate retention indices for GC data given retention times and numbers of carbons of alkanes. Although this package was primarily built with only me in mind, feel free to fork it or install it.

Installation

You can install chemhelper from r-universe like so:

# Install chemhelper in R:
install.packages('chemhelper', repos = c('https://aariq.r-universe.dev', 'https://cloud.r-project.org'))

Or you can install it directly from GitHub using the remotes package like so:

library(remotes)
install_github("Aariq/chemhelper")

chemhelper's People

Contributors

aariq avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mayassin1

chemhelper's Issues

plot_loadings()

Loading plot with optional ggrepel maybe. Should work with any kind of model made by opls()

Error: package or namespace load failed for ‘chemhelper’

Hi!
I recently installed your chemhelper package. I just ran a round of package updates and encountered the following error with the package:

Error: package or namespace load failed for ‘chemhelper’ in namespaceExport(ns, exports):
undefined exports: sim_covar, sim_df, sim_discr, sim_missing, sim_multvar
Error: loading failed
Execution halted

Any ideas what could be the reason?

Oh, and one more thing. I altered the plot_oplsda function a little bit to also include the RMSEE, pR² and pQ² values in the plot, and also to name the plot dynamically according to a list of names ("name_list"):

plotPLSDA <- function(ropls_plsda, annotate = c("caption", "subtitle")){
plotdata <- chemhelper::get_plotdata(ropls_plsda)
p <- ggplot(plotdata$scores, aes(x = p1, y = p2, color = y1)) +
geom_point() +
stat_ellipse() +
labs(x = paste0("P1 (", plotdata$axis_stats$R2X[1] * 100, "%)"),
y = paste0("P2 (", plotdata$axis_stats$R2X[2] * 100, "%)")) +
scale_color_discrete("Group Membership") +
theme_bw() +
labs(title = paste0("PLS-DA of ", name_list[i]," Samples"))
stats <- latex2exp::TeX(
paste0("$R^{2}{Y} = ", plotdata$model_stats$R2Y(cum), "$; ",
"$R^{2}
{X} = ", plotdata$model_stats$R2X(cum), "$; ",
"$Q^{2} = ", plotdata$model_stats$Q2(cum), "$; ",
"$RMSEE = ", plotdata$model_stats$RMSEE, "$; ",
"$p_{R^{2}} = ", plotdata$model_stats$pR2Y, "$; ",
"$p_{Q^{2}} = ", plotdata$model_stats$pQ2, "$"))

if (annotate == "caption"){
p + labs(caption = stats)
} else if(annotate == "subtitle"){
p + labs(subtitle = stats)
} else{
p
}
}

plot_*pls*() functions could include RMSEE

Consider printing RMSEE. Consider making an argument that takes a character vector of what stats to include. You could simply use %in% operator to check if you should print that one or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.