#Could someone help me please?
#I have a dataframe with two variables:
data<-data.frame(people=c("john","mary"),
day=c(-10,-50,-25,-25,-1,-20,20,20,30,20,NA,NA,NA,NA))
#For each person, If NA I would like to replace it with the minimum value of the variable days
#the result should be something like:
newdata<-data.frame(people=c("john","mary"),
day=c(-10,-50,-25,-25,-1,-20,20,20,30,20,-25,-50,-25,-50))