Displaying 1 result from an estimated 1 matches for "researchproject".
Did you mean:
researchprojects
2010 Dec 09
1
set dataframe field value from lookup table
...t 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>=79,79,ifelse(df$Age>=74,74,ifelse(df$Age>=69,69,ife...