Re: [R] About Assigning Missing Values

2014-01-14 Thread Adams, Jean
Your assignment of NAs is fine. When you extract, you have to remember to specify whether you want to include or exclude those NA values. Try this: data1.long[data1.long$time==9 & !is.na(data1.long$time), "time"] Jean On Tue, Jan 14, 2014 at 7:22 AM, Chia-Chieh Lin wrote: > Hi all, > >

[R] About Assigning Missing Values

2014-01-14 Thread Chia-Chieh Lin
Hi all,   I have a data set, named ‘data1.long’, which has 180 subjects with two variables, ‘time’ and ‘patient’. The ‘time’ variable takes 9 values, i.e., 1, 2, 3,…,9, and the ‘patient’ variable takes two values, 0 and 1. There are 10 subjects for each combination of ‘ti