plantphys / spectratrait

A tutorial R package for illustrating how to fit, evaluate, and report spectra-trait PLSR models. The package provides functions to enhance the base functionality of the R pls package, identify an optimal number of PLSR components, standardize model validation, and vignette examples that utilize datasets sourced from EcoSIS (ecosis.org)
GNU General Public License v3.0
11 stars 9 forks source link

Replace deprecated qplot in Vignettes #100

Open serbinsh opened 1 year ago

serbinsh commented 1 year ago

Warning: qplot() was deprecated in ggplot2 3.4.0.

e.g.

cal_hist_plot <- qplot(cal.plsr.data[,paste0(inVar)],geom="histogram",
                       main = paste0("Cal. Histogram for ",inVar),
                       xlab = paste0(inVar),ylab = "Count",fill=I("grey50"),col=I("black"),
                       alpha=I(.7))
serbinsh commented 4 months ago
HEAN3   Cal: 70%
CUSA4   Cal: 68.182%
CUPE   Cal: 70.588%
SOLYL   Cal: 70%
OCBA   Cal: 68.421%
POPUL   Cal: 71.429%
GLMA4   Cal: 70.588%
PHVU   Cal: 66.667%
[1] "Cal observations: 124"
[1] "Val observations: 54"
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
[1] "*** Identifying optimal number of PLSR components ***"
[1] "*** Running PLS permutation test ***"
[1] "*** Optimal number of components: 13"
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.
[1] "*** Running permutation test.  Please hang tight, this can take awhile ***"
[1] "Options:"
[1] "Max Components: 13 Iterations: 500 Data Proportion (percent): 70"
  |**********************************************************************| 100%
[1] "*** Providing PRESS and coefficient array output ***"
[1] "Output directory:  /private/var/folders/th/fpt_z3417gn8xgply92pvy6r0000gq/T/Rtmp27r3Fk"
[1] "**** PLSR output files: "
 [1] "N_g_m2_Bootstrap_PLSR_Coefficients.csv"       "N_g_m2_Bootstrap_Regression_Coefficients.png" "N_g_m2_Cal_PLSR_Dataset.csv"                 
 [4] "N_g_m2_Cal_Val_Histograms.png"                "N_g_m2_Cal_Val_Scatterplots.png"              "N_g_m2_Cal_Val_Spectra.png"                  
 [7] "N_g_m2_Coefficient_VIP_plot.png"              "N_g_m2_Observed_PLSR_CV_Pred_13comp.csv"      "N_g_m2_PLSR_Coefficients_13comp.csv"         
[10] "N_g_m2_PLSR_Component_Selection.png"          "N_g_m2_PLSR_Validation_Scatterplot.png"       "N_g_m2_PLSR_VIPs_13comp.csv"                 
[13] "N_g_m2_Val_PLSR_Dataset.csv"                  "N_g_m2_Validation_PLSR_Pred_13comp.csv"       "N_g_m2_Validation_RMSEP_R2_by_Component.png" 
Warning messages:
1: package ‘pls’ was built under R version 4.3.1 
2: package ‘dplyr’ was built under R version 4.3.1 
3: package ‘plotrix’ was built under R version 4.3.1 
4: package ‘ggplot2’ was built under R version 4.3.1 
5: `qplot()` was deprecated in ggplot2 3.4.0.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 
6: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
ℹ Please use `linewidth` instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 
7: The `size` argument of `element_rect()` is deprecated as of ggplot2 3.4.0.
ℹ Please use the `linewidth` argument instead.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated. 
8: Removed 3 rows containing missing values or values outside the scale range (`geom_point()`). 
9: Removed 3 rows containing missing values or values outside the scale range (`geom_point()`). 
serbinsh commented 1 month ago

Also #100 and #98