[R] R ggplot vertical and horizontal line intercept at center

2014-01-06 Thread Weijia Wang
I have a regression line, called "mean". X-axis is called "week" Now, I want to draw vertical and horizontal lines, from each point of the regression line, to x-axis and y-axis. Here is my code: ggplot()+ geom_linerange(data=df2,x=df2$week, ymin=0, ymax=df2$mean, colour="#00",size=0.1)+ ge

[R] Assign date according to defined time interval

2013-10-15 Thread Weijia Wang
Hi, I have something very interesting: Say I have this: GroupID Date 1 1 10-Dec-12 2 1 11-Dec-12 3 2 13-Dec-12 4 2 15-Dec-12 5 3 06-Dec-12 6 3 19-Dec-12 Now, I have time interval, week 1: from 9-Dec-12 to 15-Dec-12, wee

[R] Locate Patients who have multiple high blood pressure readings

2013-01-31 Thread Weijia Wang
On Thu, Jan 31, 2013 at 10:29 AM, Weijia Wang wrote: > Hi, > > > > I have a new question about subsetting in R. > > > > Say we have this data frame: > > > > PT_ID Blood_Pressure OBS_TYPE > > 92 1900 90.0 DBP > > 94 1900

[R] all duplicated wanted

2012-08-03 Thread Weijia Wang
Hi, Has anyone been able to figure out how to print all duplicated observations? I have a dataset, with patients ID, and other lab records. Some patients have multiple lab records, but 'duplicated' ID will only show me the duplicates, not the original observation. How can I print both the orig