# NOT RUN {
# read the internal lessR data frame that contains variable labels
mydata <- Read("Employee", format="lessR")
# variable label as the title of a graph from a standard R function
# the data are not attached, so for standard R functions, must
# identify the relevant data frame, such as with function: with
with(mydata, barplot(table(Dept), main=label(Dept)))
with(mydata, hist(Salary, main=label(Salary)))
# assign a new label for the variable Years in mydata
mydata <- label(Years, "Years Worked")
# verify
label(Years)
# or view all variable labels in mydata
details.brief()
mydata <- Read("Employee", format="lessR")
# specify a label of variable in a data frame other than mydata
myd <- Subset(Gender=="M")
myd <- label(Gender, "Only is Male", data=myd)
details.brief(myd)
# }
Run the code above in your browser using DataLab