Displaying 1 result from an estimated 1 matches for "fmtnames".
Did you mean:
filnames
2006 Jul 13
1
writeForeignSAS and potential extensions
...n\n",file=codefile,append=TRUE)
if (any(factors)){
cat("PROC FORMAT;\n",file=codefile,append=TRUE)
- for(v in 1:ncol(df)){
- if (factors[v]){
- cat("value ",varnames[v],"\n",file=codefile,append=TRUE)
- values<-levels(df[[v]])
+ fmtnames <- make.SAS.formats(varnames[factors])
+ fmt.values <- lapply(df[, factors, drop = FALSE], levels)
+ names(fmt.values) <- fmtnames
+ for (f in fmtnames){
+ cat("value",f,"\n",file=codefile,append = TRUE)
+ values<-fmt.values[[f]]
for(i in...