Code Monkey home page Code Monkey logo

find's People

Watchers

Jaclyn Cleary avatar

find's Issues

Display map as Lat/Long instead of Eastings/Northings

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.

Ignore NAs with min() and max() for Start and End

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.

Allow input in Eastings and Northings

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.

Fix so no error if map is outside SAR boudaries

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"

Add option to view more detailed maps (i.e., using stamenmaps)

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 reset button

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.

Fix NAs in the output table

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

Require a password to use the app -- not sure if this is necessary. Could be implemented using passwordInput("password", "Password:") as shown here.

The `crop` function issues a warning

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.

Tooltip/hover that shows the location name

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)

Calculate Latitude and Longitude from Eastings and Northings

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.

Make an interactive map

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:

  1. 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), and
  2. clicks don't seem to work, in that no data shows up in the table when a point is clicked.

Include spawns outside SAR boundaries

Currently, 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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.