specialMapTransform: A Long Transform for Special Map Type Function

Description Usage Arguments Examples

View source: R/specialMapTransform.R

Description

While most cases required a choropleth or bubble style "wide" dataframe for ingestion into EarthTime, a few special map types in EarthTime (i.e. - line strings, point flows, points, and raster maps) need to be formatted as "long" dataframes types before using create_pointMap() and/or create_flowMap() to generate a .bin file. This function transforms the dataframe in an appropriate format to successfully utilize the aforementioned functions. Use the pointMap_... and flowMap_... parameters to transform the data for Dot Maps and Flow Maps, respectively.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
specialMapTransform(
  dataframe,
  pointMap_latitude = NULL,
  pointMap_longitude = NULL,
  pointMap_dateName = NULL,
  flowMap_origin = NULL,
  flowMap_destination = NULL,
  flowMap_valueName = NULL,
  flowMap_valueColumns = NULL
)

Arguments

dataframe

Specify the name of the dataframe that you'd like to transform.

pointMap_latitude

Specify the name (in quotes) of the latitude column. You can always specify this again while invoking the create_pointMap() function. This parameter is best used when dealing with a normal "wide" style dataframe in instances where both the location values as columns.

pointMap_longitude

Specify the name (in quotes) of the longitude column. You can always specify this again while invoking the create_pointMap() function. This parameter is best used when dealing with a normal "wide" style dataframe in instances where both the location values as columns..

pointMap_dateName

Specify the name (in quotes) of what you would like to call the date column in the transformed dataframe.

flowMap_origin

Specify the name (in quotes) of the origin location. You can always specify this again while invoking the create_pointMap() function. This parameter is best used when dealing with a matrix style dataframe in instances where one location value is a single column (down) and the other location value are the column headers (across).

flowMap_destination

Specify the name (in quotes) of the final destination. You can always specify this again while invoking the create_flowMap() function. This parameter is best used when dealing with a matrix style dataframe in instances where one location value is a single column (down) and the other location value are the column headers (across).

flowMap_valueName

Specify the name (in quotes) of what you would like to call the value column in the transformed dataframe.

value_columns

A concatenated vector of the pre-transformed dataframe's date columns. Use, e.g., value_columns = c(3:223)

Examples

1
2
3
4
5
6
7
8
## Not run: 
long_df_pointMap <- specialMapTransform(dataframe, pointMap_latitude, pointMap_longitude, pointMap_dateName)

## End(Not run)
## Not run: 
long_df_flowMap <- specialMapTransform(dataframe, flowMap_origin, flowMap_destination, flowMap_valueName, flowMap_valueColumns)

## End(Not run)

andrewcberkley/EarthTimeR documentation built on Dec. 19, 2021, 3:33 a.m.