plotOn: Geographical representation of a data frame or raster map.

Description Usage Arguments Value Note See Also Examples

Description

Geographical representation of a data frame or raster map.

Usage

1
2
3
4
5
6
7
8
9
plotOn(x, map = ggmap::get_map(location = "trentino", zoom = 9),
  latlon_crs = as.character("+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"),
  layer = 1, legend = "bottomright", title = "Soil Water Content",
  label = "swc", high = "blue", low = "white", alpha = c(0.1, 0.8),
  facet_wrap = FALSE, nrow = NULL, ncol = NULL, range = NULL,
  scale = "continuous_2", scale.fill.gradient = TRUE, plot = TRUE,
  scale_colour_gradientn_scale = NULL, extent = "normal",
  method = c("bilinear", "ngb"), palette = rainbow, shape = 15,
  size = NA, ...)

Arguments

x

a Raster* class object

map

geograghical map on which x is plotted. It is an object returned by get_map or similars.

latlon_crs

string containing the utilized latitude longitude Coordinate Refarance System. See default in Usage.

layer

brick layer utilized for geographical plotting. Default is 1.

title

string title of the graphic

label

string title (label) of the legend. It is used as the name of the scale if scale.fill.gradient is TRUE, otherwise it is ignored.

high

colour for low end of gradient. See scale_fill_gradient.

low

colourf or high end of gradient. See scale_fill_gradient.

alpha

alpha coefficient. See http://en.wikipedia.org/wiki/Alpha_compositing.

facet_wrap

logical value. If TRUE it uses facet_wrap to print all plots.

nrow,ncol

number of rows and columns. See facet_wrap.

scale

alternative parameter to scale.fill.gradient, it is a term potentially added for color scale (see scale_colour_hue o similars). It is used only if it is not NULL or scale.fill.gradient is FALSE

scale.fill.gradient

logical value. If it is TRUE (Default), it uses scale.fill.gradient

plot

logical value. If TRUE (Default) the function also plots the map, otherwise returns its value without any preliminary plot.

scale_colour_gradientn_scale

color scale for scale_colour_gradientn. It is used if it is nott NULL. Default is NULL.

method

see projectRaster

palette

palette function used for scale_fill_manual .

shape,size

see geom_point

...

further arguments

Value

A "ggplot" object.

Note

Useful link: http://journal.r-project.org/archive/2013-1/kahle-wickham.pdf

See Also

geom_point,ggmap,facet_wrap

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
library(geotopVis)
data(soilwatercontent)

x <- plotOn(x=soilwatercontent[[1]])

##' ANOTHER EXAMPLE
library(geotopbricks)
# The data containing in the link are only for educational use
wpath <- "http://www.rendena100.eu/public/geotopbricks/simulations/idroclim_test1"
tz <-  "Etc/GMT-1"
when <- as.POSIXct("2002-03-22",tz=tz)

# a 2D map:
x_e <- "SnowDepthMapFile"
# Not Run: uncomment the following line
m <- rasterFromOutput2DMap(x_e,when=when,wpath=wpath,timestep="OutputSnowMaps",
                           tz=tz,use.read.raster.from.url=TRUE)
## NOTE: set use.read.raster.from.url=FALSE (default)
# if the "wpath" directorty is in the local file system.
# Not Run: uncomment the following line
m/10

plot(m/10,main="Snow Depth")



 location = c(10.5,45.5,12.5,46.5)
 map=get_map(location = location) ###, zoom = 9)


xmap <- plotOn(m/10,map=map,high="blue",low="white",title="Snow Depth",label="depth[cm]",plot=TRUE,alpha=c(0,0.3),extent="device")
xmap

ecor/geotopmap documentation built on May 15, 2019, 8:56 p.m.