Skip to content
Prev 387995 / 398502 Next

Variable labels

Thanks to all, for bearing with me.

Now I realize expss may not be what I need. I have now written a 
self-runnable, replicable set of codes (listed below). Perhaps that 
gives an idea of what I need. Question is, whethet this is the right way 
to do this (to have a clickable object to learn about variable 
definitions) or whether there are better ways. Thanks!

Steven

rm(list=ls())
n<-6
mydata<-data.frame(id=1:n,
 ?????????????????? age=floor(rnorm(n,25,10)),
 ?????????????????? yrmarry=floor(rnorm(n,5,2)))
var.labels<-c(id? = "Individual ID",
 ????????????? age = "Age in Years",
 ????????????? yrmarry = "Years of marriage")
definitions<-as.data.frame(var.labels) # declare definitions as a data frame
save.image("c:/temp/a/try1.RData")???? # save binary .RData file
rm(list=ls())????????????????????????? # clean environment
load("c:/temp/a/try1.RData") # now load .RData file and definitions are 
clickable
 ???????????????????????????? # all I need is for user to be able to click
 ???????????????????????????? # and read the variable definitions
On 2021/5/14 ?? 05:15, Jim Lemon wrote: