lookup: Lookup Function

Description Usage Arguments Examples

Description

Function to return a longer version of a variable name. The point is to be able to use short names of variables in a data frame, but be able to refer to a longer name such as for a plot label or elsewhere.

Usage

1
lookup(colname, longnames)

Arguments

colname

A character string that generally corresponds to a column names of a dataframe. This would generally be a short name, for which a longer name is desired for a plot or table.

longnames

A vector of longer variable names, where the names of longnames should include colname.

Examples

1
2
3
4
test.dat<-data.frame(x=rnorm(10),y=rbinom(10,2,.5))
longnames <- c("verbal IQ","prenatal mercury exposure (ppm)")
names(longnames)<-dimnames(test.dat)[[2]]
lookup("y",longnames)

mathykathy26/kagRfun documentation built on May 29, 2019, 4:40 a.m.