Message-ID: <4FB3CE14.5050101@gvdnet.dk>
Date: 2012-05-16T15:56:04Z
From: Troels Ring
Subject: simple data.frame question
Dear friends - I hope you will forgive me another simple question,
illustrated by
ID <- c(1,1,1,2,2,3,3,3)
PERIOD <- c(1,2,3,2,3,1,2,3)
X <- runif(8,0,10))
FF <- data.frame(ID=ID,PERIOD=PERIOD,X=X)
I need to the fourth value of X as NA, and ID and PERIOD is updated to
1,1,1,2,2,2,3,3,3 and 1,2,3,1,2,3,1,2,3 respectively.
How do I use the pattern in ID and PERIOD to find the lacking X and put NA?
Best wishes
Troels Ring,
Aalborg, Denmark