eq_create_label: Create labels for eq_map

Description Usage Arguments Value Examples

Description

Creates a label for data mapped data.

Usage

1
2
eq_create_label(data, labelcols = c("LOCATION_NAME", "EQ_PRIMARY",
  "TOTAL_DEATHS"), labellabels = c("Location", "Magnitude", "Deaths"))

Arguments

data

A data.frame output from eq_clean_data or substantially similar data. This is required as the label defaults are named as they would be in the resultant column. Must have columns named "LOCATION_NAME", "DEATHS", "EQ_PRIMARY" (respectively). These are defaults.

labelcols

A character list of column names. Defaults to assignment requirement.

labellabels

A character list of the names for the items set in labelcols. This governs what appears to the user. Setting to NULL will use the the character string in llabelcols.

Value

A string with LOCATION_NAME, EQ_PRIMARY and TOTAL_DEATHS.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
#Run with just cleaned data will produce the assignment defaults
eq_create_label(EQdata)

#Pass any columns names and associated labels
eq_create_label(EQdata,
                labelcols=c("DATE"),
                labellabels=c("EQ Estimated Date"))

#Use labellabels = NULL to preserve column names of data source as the map annotation (if its clean)
eq_create_label(EQdata,
                         labelcols="LATITUDE",
                         labellabels=NULL)
## End(Not run)

JJNewkirk/NOAAEQ documentation built on May 27, 2019, 1:12 p.m.