PrepData | R Documentation |
This function prepares an input dataset for use by all plotting functions
in this package, including the main function vlm
.
The input data dataFl
must contain, at a minimum, a date column
dateNm
and a variable to be plotted. dataFl
will be
converted to a data.table
class, and all changes are made to it by
reference.
PrepData(dataFl, dateNm, selectCols = NULL, dropCols = NULL,
dateFt = "%d%h%Y", dateGp = NULL, dateGpBp = NULL, weightNm = NULL,
varNms = NULL, dropConstants = FALSE, ...)
dataFl |
Either the name of an object that can be converted using
|
dateNm |
Name of column containing the date variable. |
selectCols |
Either |
dropCols |
Either |
dateFt |
|
dateGp |
Name of the variable that the time series plots should be
grouped by. Options are |
dateGpBp |
Name of variable the boxplots should be grouped by. Same
options as |
weightNm |
Name of the variable containing row weights, or |
varNms |
Either |
dropConstants |
Logical, indicates whether or not constant (all
duplicated or NA) variables should be dropped from |
... |
Additional parameters to be passed to
|
If weights (weightNm
) are provided, then it is normalized to have a
sum of weights equal the total sample size, and the weights are used in all
summary statistics calculations and plotting.
A data.table
object, formatted for use by all plotting
functions in this package otvPlots
, including the main function
vlm
, and the individual variable plotting function
PlotVar
.
Copyright 2017 Capital One Services, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Functions depend on this function:
PlotBarplot
,
PlotRatesOverTime
,
PlotCatVar
,
SummaryStats
,
PlotMean
,
PlotQuantiles
,
PlotRates
,
PlotDist
,
PlotNumVar
,
PlotVar
,
PrintPlots
,
CalcR2
,
OrderByR2
,
vlm
.
## Use the bankData dataset in this package
data(bankData)
bankData <- PrepData(bankData, dateNm = "date", dateGp = "months",
dateGpBp = "quarters")
## Columns have been assigned a plotting class (nmrcl/ctgrl)
str(bankData)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.