noaa-onms / onmsR

R package of common functions for dataset wrangling and plotting used across National Marine Sanctuaries, originally for interactive infographic products per Sanctuary
https://noaa-onms.github.io/onmsR
MIT License
0 stars 0 forks source link

MARINe rocky intertidal plot improvements #5

Open bbest opened 4 years ago

bbest commented 4 years ago

Melissa had the following suggested improvements for the interactive plots 1) order the sites in the legend from north to south not alphabetical 2) keep color consistent for a given site between indicators (e.g., if Sokol Pt is blue for mussel plot then it should be blue for barnacle plot) 3) the lines for sites are hard to see (thin and faint) unless you hover on one. Can they be thicker/brighter while still allowing the one on hover to be even more prominent?

bbest commented 4 years ago

Handled some of this in noaa-onms/cinms#5

mspector13 commented 4 years ago

After making sure "spp_targets.csv" was made available offline (and the other xquartz-related trouble shooting) I'm getting the following error:

Quitting from lines 30-31 (barnacles.Rmd) Error: Problem with filter() input ..1. x object 'sp_target' not found ℹ Input ..1 is sp_target %in% spp_targets. Backtrace: █

  1. ├─rmarkdown::render(...)
  2. │ └─knitr::knit(knit_input, knit_output, envir = envir, quiet = quiet)
  3. │ └─knitr:::process_file(text, output)
  4. │ ├─base::withCallingHandlers(...)
  5. │ ├─knitr:::process_group(group)
  6. │ └─knitr:::process_group.block(group)
  7. │ └─knitr:::call_block(x)
  8. │ └─knitr:::block_exec(params)
  9. │ ├─knitr:::in_dir(...)
    1. │ └─knitr:::evaluate(...)
    2. │ └─evaluate::evaluate(...)
    3. │ └─evaluate:::evaluate_call(...)
    4. │ ├─evaluate:::timing_fn(...)
    5. │ ├─base:::handle(...)
    6. │ ├─base::withCallingHandlers(...)
    7. │ ├─base::withVisible(eval(expr, envir, encl In addition: Warning messages: 1: Missing column names filled in: 'X5' [5], 'X6' [6], 'X7' [7], 'X8' [8], 'X9' [9], 'X10' [10], 'X11' [11], 'X12' [12], 'X13' [13], 'X14' [14], 'X15' [15], 'X16' [16], 'X17' [17], 'X18' [18], 'X19' [19], 'X20' [20], 'X21' [21], 'X22' [22], 'X23' [23], 'X24' [24], 'X25' [25], 'X26' [26] 2: In if (!is.na(spp_targets)) { : the condition has length > 1 and only the first element will be used Execution halted

Specifically, lines 30-31 in barnacles.Rmd:

plot_intertidal_nms(d_csv, "CINMS", "CHTBAL", "Acorn Barnacles [target = balanus | chthamalus_balanus]", c("balanus", "chthamalus_balanus"))

I'm not sure why the issue is with "spp_targets.csv", this is a small .csv that serves as a reference for the names of species in the actual data files

In rocky.R there are various filter for "spp_targets" (a column in spp_targets.csv) e.g. line 180: filter(sp_target %in% spp_targets)

bbest commented 4 years ago

Hey @mspector13,

You should've gotten an email about above git commit message since I mentioned you @mspector13.

Please try knitting barnacles.Rmd again as the data files in github_info-intertidal_data - NMS - Google Drive have been updated to include the expected columns, like sp_target in sanctuary_species_percentcover.csv.

mspector13 commented 4 years ago

Right on @bbest , thanks!

Unfortunately, Im currently still not able to knit barnacles.Rmd. However, I can run each code chunk line by line to get the desired outputs, which is a huge improvement!

Below is the error message I get when I knit this file.

List of 10 $ name : chr "PopupTable" $ version : chr "0.0.1" $ src :List of 1 ..$ file: chr "" $ meta : NULL $ script : NULL $ stylesheet: chr "popup.css" $ head : NULL $ attachment: NULL $ package : NULL $ all_files : logi TRUE

bbest commented 4 years ago

Ok @mspector13,

Since it works for me using latest R 4.0.2 and RStudio, go ahead and try installing the latest R and RStudio, then knit again:

> devtools::session_info()
─ Session info ──
 setting  value                       
 version  R version 4.0.2 (2020-06-22)
 os       macOS Catalina 10.15.6      
 system   x86_64, darwin17.0          
 ui       RStudio                     
 language (EN)                        
 collate  en_US.UTF-8                 
 ctype    en_US.UTF-8                 
 tz       America/Los_Angeles         
 date     2020-09-01    
mspector13 commented 3 years ago

Captions and external sources have been added to the figures for this .Rmd file. However, I'm getting the same error message as I did when I tried to knit Algal-groups.Rmd:

Quitting from lines 16-17 (barnacles.Rmd) Error in get_nms_ply(nms) : could not find function "get_nms_ply" Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> map_nms_sites

Everything for this modal window should be ready to go once this error is fixed

bbest commented 3 years ago

All code moved to nms4r, so hopefully problems above are no more.

Also, I'm questioning appropriateness of request 1. order the sites in the legend from north to south not alphabetical given East to West orientation of Channel Island sites:

image

bbest commented 3 years ago

These aspects should be updating in this new R package onmsR per the