Learn R Programming

tabs (version 0.2.0)

regroup: regroup

Description

regroup shapes by recname identifier or by interconnected cluster (group)

Usage

regroup(
  filename,
  by = c("group", "recname"),
  extant = FALSE,
  group = TRUE,
  recname = NULL
)

Value

list of regrouped shapes

Arguments

filename

path where files or qs2/rds was exported, reconstruct object of class tabs or recvect object

by

character varying, restructure by interconnected cluster ('group'), or by recname ('recname')

extant

boolean, only currently existing shapes (TRUE) or all shapes (FALSE) are returned

group

boolean, if TRUE, all shapes of the group will be returned.

recname

character varying, by specifying a recname of interest, only shapes are returned for its group or recname

Author

Johannes De Groeve

Examples

Run this code
#' # load data samples
sporades <- sporades()
topo <- sporades$topo
labs <- sporades$labs
correction <- sporades$correction
curve <- sporades$curve

# subset first and last period 
curve <- curve[[seq(1,dim(curve)[3],4)]]

# reconstruct
rec <- reconstruct(topo=topo,
                   region=labs,
                   curve=curve,
                   correction=correction,
                   reclabs='name'
                   )
                   
# regroup by group and return all shapes within group
recv <- regroup(filename=rec,
                by='group',
                group=TRUE,
                extant=FALSE)
# regroup by group and only return main group shape
recv <- regroup(filename=rec,
                by='group',
                group=FALSE,
                extant=FALSE)
# regroup by recname and return all shapes within group
recv <- regroup(filename=rec,
                by='recname',
                group=TRUE,
                extant=FALSE)
# regroup by group and only return main group shapes
recv <- regroup(filename=rec,
                by='recname',
                group=FALSE,
                extant=FALSE)
# regroup by recname and return all shapes within group
recv <- regroup(filename=rec,
                by='recname',
                recname='Nisída Ágios Geórgios',
                group=TRUE,
                extant=FALSE)
# regroup by group and only return main group shapes
recv <- regroup(filename=rec,
                by='recname',
                recname='Nisída Ágios Geórgios',
                group=FALSE,
                extant=FALSE)

# only extant (present day existing shapes)

# regroup by group and return all shapes within group
recv <- regroup(filename=rec,
                by='group',
                group=TRUE,
                extant=TRUE)
# regroup by group and only return main group shapes
recv <- regroup(filename=rec,
                by='group',
                group=FALSE,
                extant=TRUE)
# regroup by recname and return all shapes within group
recv <- regroup(filename=rec,
                by='recname',
                group=TRUE,
                extant=TRUE)
# regroup by group and only return main group shapes
recv <- regroup(filename=rec,
                by='recname',
                group=FALSE,
                extant=TRUE)
# regroup by recname and return all shapes within group
recv <- regroup(filename=rec,
                by='recname',
                recname='Nisída Ágios Geórgios',
                group=TRUE,
                extant=TRUE)
# regroup by group and only return main group shapes
recv <- regroup(filename=rec,
                by='recname',
                recname='Nisída Ágios Geórgios',
                group=FALSE,
                extant=TRUE)
                

Run the code above in your browser using DataLab