Displaying 1 result from an estimated 1 matches for "dstzlook".
2010 Dec 09
1
set dataframe field value from lookup table
...another dataframe. Here's the script (that does not work). 2 questons,
1) Anyone know of a more elegant way to calculate the "rounded" age value
than the nested ifelse's I've used?
2) how to reference the lookup table based on computed indices?
Thanks
Jon
# Define tables
DSTzlook <-
read.table("/Users/jween/Documents/ResearchProjects/ABC/data/DSTz.txt",
header=TRUE, sep="\t", na.strings="NA", dec=".", strip.white=TRUE)
df<-stroke
# Compute rounded age.
df$Agetmp
<-ifelse(df$Age>=89,89,ifelse(df$Age>=84,84,ifelse(df$Age...