import_app_rds: Import app rds

Description Usage Arguments Details Value Examples

View source: R/anem_shiny_related.R

Description

Import rds output from anem-app

Usage

1
import_app_rds(path, params = NULL, gen_well_images = TRUE)

Arguments

path

Path to rds file downloaded from web

params

List objected loaded from the rds files

gen_well_images

Boolean value. If TRUE, output wells includes well images.

Details

The rds files downloaded from the web application contain the raw data and map click information needed for the app. This function converts those raw values to UTM coordinates for processing with the R package.

Either path or params should be supplied to the function. If both are specified, only path will be used.

Value

Returns a list containing aquifer, wells, and particles that were input into the web application.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# using built in package data
app <- import_app_rds(params=anem_app_scenario)

# using RDS file
file <- tempfile("anem_app_scenario.rds")
saveRDS(anem_app_scenario,file)
app <- import_app_rds(file)

#' # view the data
gridded <- get_gridded_hydrodynamics(app$wells,app$aquifer,c(80,80),c(8,8))
library(ggplot2)
ggplot() +
  geom_raster(data=gridded$head,aes(x,y,fill=head_m)) +
  geom_segment(data=gridded$flow,aes(x,y,xend=x2,yend=y2),
               arrow = arrow(ends="last",type="closed",length=unit(1,"mm")),color="black") +
  geom_segment(data=app$aquifer$bounds,aes(x1,y1,xend=x2,yend=y2,linetype=bound_type)) +
  coord_equal()

gopalpenny/anem documentation built on Dec. 20, 2020, 5:27 a.m.