R/util.R

Defines functions trim

#' @title remove whitespace
#' @description remove whitespaces from any data
#' @param x input data
#' @return data without whitespaces
#' @author Sagar Ganapaneni (sagar123)

# define global variables:
utils::globalVariables(c('Distance_data_master', 
                  'TO_Distance', 'TO_id', 'day', 'flag', 
                  'latitude', 'longitude', 'metric', 'state',
                  'value', 'weekStart'))

trim <- function (x) {
  # to avoid scentific notation
  options(scipen = 999)
  gsub("^\\s+|\\s+$", "", x)
}

Try the NOAAWeather package in your browser

Any scripts or data that you put into this service are public.

NOAAWeather documentation built on March 21, 2018, 5:08 p.m.