plot3dmap: Interactive Plot3d and map

View source: R/plot3dmap.r

plot3dmapR Documentation

Interactive Plot3d and map

Description

The function plot3dmap() draws a 3d-plot of three given variables $names.var$ and a map with sites of coordinates coordinates(sp.obj).

Usage

plot3dmap(sf.obj, names.var, box = TRUE,  
  criteria = NULL, carte = NULL, identify = NULL, cex.lab = 0.8,
  pch = 16, col = "lightblue3", xlab = "", ylab = "", zlab = "", 
  axes = FALSE, lablong = "", lablat = "")

Arguments

sf.obj

object of class sf

names.var

a vector of three characters; attribute names or column numbers in attribute table

box

a boolean with TRUE for drawing a box on the scatterplot 3d

criteria

a vector of boolean of size the number of Spatial units, which permit to represent preselected sites with a cross, using the tcltk window

carte

matrix with 2 columns for drawing spatial polygonal contours : x and y coordinates of the vertices of the polygon

identify

if not NULL, the name of the variable for identifying observations on the map

cex.lab

character size of label

pch

16 by default, symbol for selected points

col

"lightblue3" by default, color of bars on the histogram

xlab

a title for the graphic x-axis

ylab

a title for the graphic y-axis

zlab

a title for the graphic z-axis

axes

a boolean with TRUE for drawing axes on the map

lablong

name of the x-axis that will be printed on the map

lablat

name of the y-axis that will be printed on the map

Details

Sites selected on the map by ‘points’ or ‘polygon’ are represented in red in the 3-d plot.

Value

In the case where user click on save results button, a vector of integer is created as a global variable in last.select object. It corresponds to the number of spatial units selected just before leaving the Tk window.

Note

This function uses the rgl package and open a rgl device.

Author(s)

Thomas-Agnan C., Aragon Y., Ruiz-Gazen A., Laurent T., Robidou L.

References

Thibault Laurent, Anne Ruiz-Gazen, Christine Thomas-Agnan (2012), GeoXp: An R Package for Exploratory Spatial Data Analysis. Journal of Statistical Software, 47(2), 1-23.

See Also

scattermap

Examples

## Not run:  
# data on price indices of real estate in France
data(immob, package = "GeoXp")

# immob is a data.frame object. We have to create
# a Spatial object, by using first the longitude and latitude
require(sf)
immob.sf <- st_as_sf(immob, coords = c("longitude", "latitude"))
# optional : we add some contours that don't correspond to the spatial unit
# but are nice for mapping
midiP <- st_read(system.file("shapes/region.shp", package="GeoXp")[1])
# an example of plot3dmap
plot3dmap(immob.sf, c("prix.vente", "prix.location", "variation.vente"),
  box = FALSE, carte = midiP, identify = "Nom", cex.lab = 0.5,
  xlab = "prix.vente", ylab = "prix.location", zlab = "variation.vente")

######
# data eire
eire <- st_read(system.file("shapes/eire.shp", package="spData")[1])

# an example of use
plot3dmap(eire, c("A", "RETSALE", "INCOME"), 
  xlab = "A", ylab = "RETSALE", zlab = "INCOME")

## End(Not run)

tibo31/GeoXp documentation built on April 8, 2023, 7:50 a.m.