Commit 8c090f6c authored by levintow's avatar levintow
Browse files

updating R script for reading in raw WIHS data

parent e1840258
......@@ -3,15 +3,11 @@ w<-read.table("/Users/salevintow/Documents/R Software Development/WIHS2009/raw_d
colnames(w)<-c("id","idu","white","age","cd4","drop","delta","art","time")
# Review variables and make sure data read in correctly
str(w)
# ART variable is currently a factor
# ART variable is currently a factor w/ 489 levels
# Need to convert to numeric and replace '.' with NA
w$art_temp<-as.character(w$art)
w$art_temp2<-ifelse(w$art_temp=="."," ",w$art_temp)
w$art_num<-as.numeric(w$art_temp2)
w$art<-w$art_num
w$art_temp<-NULL
w$art_temp2<-NULL
w$art_num<-NULL
w$art<-as.character(w$art)
w$art<-ifelse(w$art=="."," ",w$art)
w$art<-as.numeric(w$art)
# Save R data set in repository
save(w,file="wihs.Rda")
# Load R data set
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment