grinnellm / find Goto Github PK
View Code? Open in Web Editor NEW:mag_right: Find Pacific Herring spawns
:mag_right: Find Pacific Herring spawns
Would require re-working all the functions to deal with Lat/Long throughout, or transforming the CRS right before mapping. The second way might be easier at this point. Would be good to use the sf
package to simplify wrangling and plotting for spatial objects.
Could be another download button for jpegs, or the user could input the type of file.
Start = min(Start, na.rm = TRUE)
creates tons of warnings unless I omit the na.rm = TRUE
part. But if I omit it, many start times are NA. I need this in two places for both Start and End dates: in the code that loads the spawn data from the CSV, and in CropSpawn
if summarizing spawns by Location.
Instead of providing data in ./Data
Allow user to input Eastings and Northings (instead of Latitude and Longitude). The script now has a funny mix of Latitude and Longitude for input, and Eastings and Northings for output. Not sure what to do about this though: usually we hear about the spill location in Latitude and Longitude, but the output makes sense for measuring distances.
Check "SAR boundaries" to see the edge (top left corner). Works OK with
Longitude = -127.425
Latitude = 51.659
Map edge = 17
Reproduce the error with
Map edge = 15
Produces an error because the map is outside the SAR:
error in evaluating the argument 'x' in selecting a method for function 'nrow': cannot get a slot ("Polygons") from an object of type "NULL"
The location name would make it easier to identify areas.
Would probably require that maps are shown in Lat/Long (i.e., I think stamenmaps are in WGS 1984.
Something like this:
require( ggmap )
na_bbox <- c( left=-124.1, bottom=49.125, right=-123.825, top=49.3 )
na_map <- get_stamenmap( na_bbox, zoom=12, maptype="terrain" )
ggmap( na_map )
Add button to "reset" the inputs. This would be good in case a user puts in inputs that cause an error. I've started working on this as shown here, but it's not working. Need to add "shinyjs" to UsePackages
, and then add actionButton("resetAll", "Reset all")
near the submitButton
in the user interface. Finally, add observeEvent( input$resetAll, reset("form") )
to the server. These are in the script, but are currently commented out.
Right now they are blank. If I fix them using
res[is.na(res)] <- "NA"
in output$dat
the columns in are aligned to the left (not right, as they should for numbers).
Require a password to use the app -- not sure if this is necessary. Could be implemented using passwordInput("password", "Password:")
as shown here.
Either in the plot title or legend.
The crop
function in the "raster" package issues a warning:
seq.default(along = cand): partial argument match of 'along' to 'along.with'
in my function CropSpawn
:
datSP <- crop( x=datSP, y=ext )
It's not an error, but it's annoying to me and might look odd to someone that is not familiar with R's warnings. One thing I tried is
isInside <- gIntersects( datSP, ext, byid=TRUE )
datSP <- datSP[isInside[1, ], ]
where ext
is a bbox
object (or something different from what it is now).
This kinda works, but misses some points.
Include a tooltip/hover that shows the location name on the figure. I think this is implemented by ggplotly
, but I can't get it to work. Something like:
UsePackages( "ggplotly" )
plotlyOutput(...)
renderPlotly(...)
ggplotly( hMap)
In some cases, Latitude and Longitude are missing. This occurs when the script uses dive survey transect Eastings and Northings to fill in missing Latitude and Longitude values (I think). It's not a problem, except that Lat and Long are NA in the downloadable table. Would be nice to fill these in.
Would go beside the option to subset by Year(s).
Make an interactive figure/map either using plotly
or clicks. Theoretically this could be done as shown here. For example, add the line
hMap <- ggplotly( p=hMap, width=800, height=700, originalData=FALSE )
to the output$map
function.
And then add
tableOutput( outputId="mapClickPoints" )
to the Figure
tab. Also add
click="mapClick"
to the plotOutput
function.
Finally, this function would follow the output$map
function to show the selected/clicked points:
output$mapClickPoints <- renderTable({
res <- nearPoints( df=spawnSub(), coordinfo=input$mapClick )
# if( nrow(res) == 0 )
# return()
res
})
Some notes on making the map interactive using plotly or clicks, neither of which are working properly:
plotly
works, but the figure lacks some necessary components. For example geom_label
is not understood (for labelling Sections), and it is not able to have more than one legend (two legends are required when summarising spawns by Location; one for mean spawn index, and one for number of spawns), andCurrently, the analysis only includes spawns that occur inside (or close to the edge) of the major and minor SAR boudaries. This should be updated to include all spawns (though there are not very many outside the SAR boundaries).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.