create_Points: Create Points

View source: R/create.R

create_PointsR Documentation

Create Points

Description

Create Points to display point locations. Buffering points may be used to produce bubble charts.

Usage

create_Points(
  Input,
  NamesIn = NULL,
  Buffer = 0,
  Clip = FALSE,
  SeparateBuf = TRUE
)

Arguments

Input

input dataframe.

If NamesIn is not provided, the columns in the Input must be in the following order:

Latitude, Longitude, Variable 1, Variable 2, ... Variable x.

NamesIn

character vector of length 2 specifying the column names of Latitude and Longitude fields in the Input. Latitudes name must be given first, e.g.:

NamesIn=c('MyLatitudes','MyLongitudes').

Buffer

numeric, radius in nautical miles by which to expand the points. Can be specified for each point (as a numeric vector).

Clip

logical, if set to TRUE, polygon parts (from buffered points) that fall on land are removed (see Clip2Coast).

SeparateBuf

logical, if set to FALSE when adding a Buffer, all spatial objects are merged, resulting in a single spatial object.

Value

Spatial object in your environment. Data within the resulting spatial object contains the data provided in the Input plus additional "x" and "y" columns which corresponds to the projected points locations and may be used to label points (see examples).

To see the data contained in your spatial object, type: View(MyPoints).

See Also

create_Lines, create_Polys, create_PolyGrids, create_Stations, create_Pies.

Examples



# For more examples, see:
# https://github.com/ccamlr/CCAMLRGIS#create-points

#Simple points with labels

MyPoints=create_Points(Input=PointData)
plot(st_geometry(MyPoints))
text(MyPoints$x,MyPoints$y,MyPoints$name,adj=c(0.5,-0.5),xpd=TRUE)






CCAMLRGIS documentation built on Sept. 27, 2023, 9:09 a.m.