shift_lon_lat: Shift lon and lat

Description Usage Arguments

View source: R/load-random-forest-data.R

Description

Simply replace lon and lat with those in the reference dataframe

Usage

1
2
shift_lon_lat(dataframe, reference_df, lon_lat_names = c("lon", "lat"),
  shift_amount = NULL)

Arguments

dataframe

a dplyr dataframe.

reference_df

a reference dataframe that must contain at least longitude and latitude. A dataframe.

lon_lat_names

name of longitude and latitude variables. A character vector. Example: by default lon_lat_names = c("lon", "lat")

shift_amount

a named list of two numbers. If longitude and latitude should be shifted, by how much should they be shifted? By default shift_amount is set to NULL. If shift amount is set to NULL, longitude and latitude in the dataframe are replaced by longitude and latitude in the reference dataframe. If you need to shift longitude and latitude by a fixed amount, simply set the argument shift amount like this: list(lon = 1, lat = 2). In this case, longitude is shifted by adding 1 unit and latitude is shifted by adding 2 units. Note that shift_amount is a list with specific names.


pegoraro/qchlorophyll documentation built on May 24, 2019, 11:46 p.m.