TNC-NMFO / NWLAND

carbon accounting model
0 stars 0 forks source link

solely NM | Start plot_caland() at Sun Apr 03 08:39:25 2022 Error in `f()`: ! Insufficient values in manual scale. 4 needed but only 2 provided. Run `rlang::last_error()` to see where the error occurred. #156

Open sbassett opened 2 years ago

sbassett commented 2 years ago

Running the plot_caland runscript on local machine. This sounds familiar! Will look back at early issues.

sbassett commented 2 years ago
> rlang::last_error()
<error/rlang_error>
Error in `f()`:
! Insufficient values in manual scale. 4 needed but only 2 provided.
Backtrace:
  1. global plot_caland(...)
  3. ggplot2 `<fn>`(...)
  5. ggplot2:::grid.draw.ggplot(plot)
  7. ggplot2:::print.ggplot(x)
  9. ggplot2:::ggplot_build.ggplot(x)
 10. base::lapply(data, scales_map_df, scales = npscales)
 11. ggplot2 FUN(X[[i]], ...)
 13. base::lapply(scales$scales, function(scale) scale$map_df(df = df))
 14. ggplot2 FUN(X[[i]], ...)
 15. scale$map_df(df = df)
 16. ggplot2 f(..., self = self)
 17. base::lapply(aesthetics, function(j) self$map(df[[j]]))
 18. ggplot2 FUN(X[[i]], ...)
 19. self$map(df[[j]])
 20. ggplot2 f(..., self = self)
 21. self$palette(n)
 22. ggplot2 f(...)
Run `rlang::last_trace()` to see the full context.
sbassett commented 2 years ago

Hypotheses to test:

sbassett commented 2 years ago

Starting by attempting to run the code that Aaron successfully ran on COGEOPROC 4/1 on my laptop, using the same inputs.

Encountered error:

Start plot_caland() at Sun Apr 03 09:04:26 2022 
Error in theme_set(theme_bw()) : could not find function "theme_set"

To me this indicates hypothesis 2 can't be rejected.

Will now check the two Vintages of output file A_Historical_nm_rcp45_climNA_output_mean_BC1_NR120.xls as suggested under Hypothesis 1.

sbassett commented 2 years ago

I can't find any structural differences between the two vintages of A_Historical_nm_rcp45_climNA_output_mean_BC1_NR120.xls. Will now check the other scenario outputs for consistency.

sbassett commented 2 years ago

While running line by line, I can get to line 2251 without error. Error triggered in block that ends on line 2420.

sbassett commented 2 years ago

Error originates at line 2269:

>                             do.call( ggsave, c(list(filename=out_file, plot=p), p$save_args ) )
Error in `f()`:
! Insufficient values in manual scale. 4 needed but only 2 provided.
Run `rlang::last_error()` to see where the error occurred.