From ffc2c90683df0fe533fdc76f820caefec2b908fc Mon Sep 17 00:00:00 2001 From: Edvin Fuglebakk Date: Thu, 7 Dec 2023 15:10:02 +0100 Subject: [PATCH] Fixed issue with plotting mean weight/length at age when no groupingvariables are used. --- DESCRIPTION | 4 ++-- NEWS.md | 3 +++ R/StoxPlots.R | 2 +- inst/testresources/meanWeightReportIssue.rds | Bin 0 -> 913 bytes inst/tinytest/test-StoxPlots.R | 3 +++ 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 inst/testresources/meanWeightReportIssue.rds diff --git a/DESCRIPTION b/DESCRIPTION index 5278c590..4275f047 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: RstoxFDA -Version: 1.3.0-9001 -Date: 2023-08-24 +Version: 1.3.0-9002 +Date: 2023-12-07 Title: Fisheries Dependent Analysis with RstoX Authors@R: c( person(given = "Arne Johannes", diff --git a/NEWS.md b/NEWS.md index da17abd6..ac3365d3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,6 @@ +# RstoxFDA v1.3-9002 +* Fixed issue with PlotMeanWeightAtAge and PlotMeanLengthAtAge that would not plot mean values for configurations with no grouping variables + # RstoxFDA v1.2.1-9001 * Fixed issue where the DefineCarNeighbours would format column headers differently depending on the chosen DefinitionMethods. The column header 'CarValue' is now consistently written in the singular form, which means that output from the DefinitionMethod 'StratumPolygon' has changed, and the json schema for CarNeighbours has changed. * Fixed the behavior of AddStratumStoxLanding so that it assigns area NA, rather than halting with error, when positions cannot be assigned to an area. diff --git a/R/StoxPlots.R b/R/StoxPlots.R index d0b2f849..534d79c1 100644 --- a/R/StoxPlots.R +++ b/R/StoxPlots.R @@ -724,7 +724,7 @@ PlotMeanVariableAtAge <- function(ReportFdaVariableAtAgeData, tableName="MeanWei if (nrow(ReportFdaVariableAtAgeData$GroupingVariables) == 0){ pl <- ggplot2::ggplot(ReportFdaVariableAtAgeData[[tableName]], ggplot2::aes(group=1)) + - ggplot2::geom_line(ggplot2::aes(x=.data[["AgeGroup"]], y=variable), linetype="solid") + + ggplot2::geom_line(ggplot2::aes(x=.data[["AgeGroup"]], y=.data[[variable]]), linetype="solid") + ggplot2::geom_line(ggplot2::aes(x=.data[["AgeGroup"]], y=.data[["High"]]), linetype="dashed") + ggplot2::geom_line(ggplot2::aes(x=.data[["AgeGroup"]], y=.data[["Low"]]), linetype="dashed") } diff --git a/inst/testresources/meanWeightReportIssue.rds b/inst/testresources/meanWeightReportIssue.rds new file mode 100644 index 0000000000000000000000000000000000000000..009cdc1039be2e40fe5dc566061371fbaa139186 GIT binary patch literal 913 zcmV;C18)2uiwFP!000001HD!|OcYTReJsn@52E;2z(1%EnOQy-BZVJziELgl8QQHL7eTVGW^7ctwtybfm>!T#-t&RHCO6 zUn;3gB~_`UI+fIWBjR`hVkbnJuQbyz72FYmdaP%jjAVK1WvYIo&F zwN1QBepaKk*W?#-dZUaf+SV(_F>k_LRx2meHl5>g66>bmXKF~bVL5FM7s=@X<#g&E-TcY&y0YVK z<&*UuvEn?4b6W3_Vd#H}`WZAVt78|SZBr4jwAN5;|4!=T%6}$ z>b>Bs`^D>8&cpvap65LB!Lo7aisKx%g-**Z;JLdj^1!yqa|!dGh`u}c6A2kt{Skaj zGBKD<->JHAYkM1bI&pLhPWg?{iBMDEdZ4M@2ww09TCPNK&vWLOwcuoH2fE&Rn&EJo z6K?G&w;Zc4n&%c>5{bl!Q{CmD5wX;HFqqq9M2+&OaVh9$Bh6vj(Xl~(c_0+^heJlN zJmL>FhyBg?J}UeG{_)Y35A$y`4ZcKDWLg5;7Hc{Vgj&uU;ea|`BstNOK$x&F-CDSe nh