Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #3

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Authors@R: c(
)
Description: The goal of `PlotFTIR` is to easily and quickly kick-start the production of journal-quality Fourier Transform Infra-Red (FTIR) spectral plots in R using ggplot2. The produced plots can be published directly or further modified by ggplot2 functions.
L'objectif de `PlotFTIR` est de démarrer facilement et rapidement la production des tracés spectraux de spectroscopie infrarouge à transformée de Fourier (IRTF) de qualité journal dans R à l'aide de ggplot2. Les tracés produits peuvent être publiés directement ou modifiés davantage par les fonctions ggplot2.
License: MIT + file LICENSE
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
Imports:
Expand All @@ -29,3 +29,4 @@ Suggests:
rmarkdown
Config/testthat/edition: 3
VignetteBuilder: knitr
BugReports: https://https://github.com/NRCan/PlotFTIR/issues
13 changes: 13 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
YEAR: 2024
COPYRIGHT HOLDER: His Majesty the King in Right of Canada, as represented by the Minister of Natural Resources, 2024

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
616 changes: 595 additions & 21 deletions LICENSE.md

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions R/manipulations.R
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,12 @@ rename_plot_sample_ids <- function(ftir_spectra_plot, sample_ids) {

if (!requireNamespace("ggthemes", quietly = TRUE) || length(unique(ftir_spectra_plot$sample_id)) > 15) {
p <- ftir_spectra_plot +
ggplot2::scale_color_viridis_d(labels = new_ids)
ggplot2::scale_color_viridis_d(labels = new_ids) +
ggplot2::scale_x_reverse()
} else {
p <- ftir_spectra_plot +
ggthemes::scale_color_calc(labels = new_ids)
ggthemes::scale_color_calc(labels = new_ids) +
ggplot2::scale_x_reverse(minor_breaks = scales::breaks_width(-200))
}

return(p)
Expand Down
4 changes: 2 additions & 2 deletions R/plot_ftir.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,15 @@ plot_ftir_core <- function(ftir, plot_title = "FTIR Spectra", legend_title = "Sa
}

p <- p +
ggplot2::scale_x_reverse(minor_breaks = scales::breaks_width(-200)) +
ggplot2::labs(
title = plot_title[1],
subtitle = if (length(plot_title) < 2) NULL else plot_title[2], # Can't return Null from ifelse()
x = xtitle,
y = ytitle
) +
ggplot2::guides(color = ggplot2::guide_legend(title = legend_title), x = ggplot2::guide_axis(minor.ticks = TRUE)) +
ggplot2::theme_light()
ggplot2::theme_light() +
ggplot2::scale_x_reverse(minor_breaks = scales::breaks_width(-200))

if (!requireNamespace("ggthemes", quietly = TRUE) || length(unique(ftir$sample_id)) > 15) {
p <- p +
Expand Down
10 changes: 7 additions & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ library(magrittr)

# PlotFTIR <img src='man/figures/PlotFTIR_logo.png' align="right" width="25%" min-width="120px"/>

([Français](#introduction-et-installation))

<!-- badges: start -->
[![R-CMD-check](https://github.com/pbulsink/PlotFTIR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pbulsink/PlotFTIR/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/pbulsink/PlotFTIR/graph/badge.svg?token=zrndO2tPwv)](https://codecov.io/gh/pbulsink/PlotFTIR)
[![CRAN status](https://www.r-pkg.org/badges/version/PlotFTIR)](https://CRAN.R-project.org/package=PlotFTIR)
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
<!-- badges: end -->

([Français](#introduction-et-installation))

[![CRAN status](https://www.r-pkg.org/badges/version/PlotFTIR)](https://CRAN.R-project.org/package=PlotFTIR)
[![CRAN version](https://www.r-pkg.org/badges/version/PlotFTIR)](https://cran.r-project.org/package=PlotFTIR)
`r badger::badge_doi("", "green")`
<!-- badges: end -->

## Introduction and Installation
The goal of `PlotFTIR` is to easily and quickly kick-start the production of journal-quality Fourier Transform Infra-Red (FTIR) spectral plots in R using ggplot2. The produced plots can be published directly or further modified by ggplot2 functions.
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@

# PlotFTIR <img src='man/figures/PlotFTIR_logo.png' align="right" width="25%" min-width="120px"/>

([Français](#introduction-et-installation))

<!-- badges: start -->

[![R-CMD-check](https://github.com/pbulsink/PlotFTIR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/pbulsink/PlotFTIR/actions/workflows/R-CMD-check.yaml)
[![codecov](https://codecov.io/gh/pbulsink/PlotFTIR/graph/badge.svg?token=zrndO2tPwv)](https://codecov.io/gh/pbulsink/PlotFTIR)
[![CRAN
status](https://www.r-pkg.org/badges/version/PlotFTIR)](https://CRAN.R-project.org/package=PlotFTIR)
[![Lifecycle:
stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
<!-- badges: end -->

([Français](#introduction-et-installation))
[![CRAN
status](https://www.r-pkg.org/badges/version/PlotFTIR)](https://CRAN.R-project.org/package=PlotFTIR)
[![CRAN
version](https://www.r-pkg.org/badges/version/PlotFTIR)](https://cran.r-project.org/package=PlotFTIR)
[![](https://img.shields.io/badge/doi--green.svg)](https://doi.org/)
<!-- badges: end -->

## Introduction and Installation

Expand Down
Binary file modified man/figures/README-biodiesel_rename_en-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-biodiesel_rename_fr-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-tidy_en-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-tidy_fr-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading